From 4ef8da586640712e67feef123c072d2a291f44e5 Mon Sep 17 00:00:00 2001 From: Manjeet Thadani Date: Thu, 22 Jun 2023 16:42:35 +0530 Subject: [PATCH] Added GH action to deploy to dev --- .github/workflows/dev-deploy.yaml | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/dev-deploy.yaml diff --git a/.github/workflows/dev-deploy.yaml b/.github/workflows/dev-deploy.yaml new file mode 100644 index 0000000..9f7c927 --- /dev/null +++ b/.github/workflows/dev-deploy.yaml @@ -0,0 +1,47 @@ +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 /