nautilytics
2/17/2020 - 1:49 AM

A Github action for deploying the UK Political Atlas to S3 after a merged pull request

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'