Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GH action to deploy to dev #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/dev-deploy.yaml
Original file line number Diff line number Diff line change
@@ -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 /