Skip to content

Instantly share code, notes, and snippets.

@JamesMillerBlog
Last active December 11, 2022 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesMillerBlog/6e1a27e19cfa4e50201083ba5788c3e9 to your computer and use it in GitHub Desktop.
Save JamesMillerBlog/6e1a27e19cfa4e50201083ba5788c3e9 to your computer and use it in GitHub Desktop.
Wrapper.js Github Actions example
on:
pull_request:
types: [ opened, reopened ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: latest
- uses: hashicorp/setup-terraform@v2
- name: Install Serverless Framework
run: npm install -g serverless
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Install Wrapper.js
run: npm install -g jamesmillerblog/wrapper.js
- name: Create PR Secret
run: gobble duplicate ${{ secrets.WRAPPERJS_SECRET_NAME }} ${{ github.event.number }}
- name: Retrieve Environment Secrets
run: gobble secrets pr-${{ github.event.number }}-${{ secrets.WRAPPERJS_SECRET_NAME }}
- name: Terraform Init
run: gobble tf init
- name: Terraform Plan
run: gobble tf plan
- name: Terraform Apply
run: gobble tf apply
- name: Retrieve Terraform Generated Secrets
run: gobble secrets pr-${{ github.event.number }}-${{ secrets.WRAPPERJS_SECRET_NAME }}
- name: Deploy Back End
run: gobble sls deploy
- name: Deploy Front End
run: gobble next export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment