Skip to content

Commit

Permalink
ci: add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan committed Aug 9, 2023
1 parent 0c38ce0 commit d0d3047
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
devnet-1:
name: Deploy to devnet-1
runs-on: ubuntu-latest
environment: devnet-1
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Build
run: npm run build

- name: Configure AWS credentials for devnet-1 account
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 }}
role-to-assume: arn:aws:iam::268276581508:role/TerraformRole
role-session-name: Terraform-TerraformRole-session
aws-region: us-east-1
role-skip-session-tagging: true
role-duration-seconds: 3600

- name: Sync S3 bucket
run: |
aws s3 sync dist s3://${{ vars.DOMAIN_NAME }}
- name: Invalidate Cloudfront caches
run: |
aws cloudfront create-invalidation --distribution-id ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"

0 comments on commit d0d3047

Please sign in to comment.