Dev - Deploy #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dev - Deploy | |
on: workflow_dispatch | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
AWS_REGION: us-east-1 # set this to your preferred AWS region, e.g. us-west-1 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: development | |
strategy: | |
matrix: | |
node-version: [16.13.2] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Generate build | |
run: | | |
npm install | |
npm run build-static | |
env: | |
CI: false | |
NODE_OPTIONS: --max_old_space_size=4096 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: arn:aws:iam::679464682883:role/githubactions | |
role-session-name: Github | |
aws-region: ${{ env.AWS_REGION }} | |
# publish to prod environment | |
- name: Deploy to S3 | |
run: | | |
aws s3 sync dist-static s3://test-sdk.dev.airstack.xyz | |
aws cloudfront create-invalidation --distribution-id EVKHJLP5XQ68I --paths / |