Skip to content

Merge pull request #232 from chamaileon-sdk/release/split #99

Merge pull request #232 from chamaileon-sdk/release/split

Merge pull request #232 from chamaileon-sdk/release/split #99

name: Build and Deploy to Staging
on:
push:
branches:
- staging
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: setup node
uses: actions/setup-node@v1
with:
node-version: '22.x'
# Run the build script which populates the ./dist folder
- name: build
run: |
npm i
npm run build
# Upload to S3
- name: sync s3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --delete
env:
SOURCE_DIR: './dist'
AWS_REGION: 'us-east-1'
AWS_S3_BUCKET: ${{ secrets.DEPLOY_STAGING_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOY_STAGING_API_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOY_STAGING_SECRET }}
# Invalidate Cloudfront (this action)
- name: invalidate
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.DEPLOY_STAGING_CLOUDFRONT_DISTRIBUTION }}
PATHS: '/index.html'
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOY_STAGING_API_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOY_STAGING_SECRET }}