Skip to content

Instantly share code, notes, and snippets.

@nautilytics
Created February 17, 2020 01:49
Show Gist options
  • Save nautilytics/aa0b61605065ce1587d762b7e9cccbb1 to your computer and use it in GitHub Desktop.
Save nautilytics/aa0b61605065ce1587d762b7e9cccbb1 to your computer and use it in GitHub Desktop.
A Github action for deploying the UK Political Atlas to S3 after a merged pull request
name: Deploy Staging Branch
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.13.0
- name: Build app
working-directory: .
run: |
npm install
npm run build:staging
- name: Deploy to S3 website bucket
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: './dist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment