Skip to content

Merge pull request #24 from mattyocode/dependabot/npm_and_yarn/tar-6.2.1 #102

Merge pull request #24 from mattyocode/dependabot/npm_and_yarn/tar-6.2.1

Merge pull request #24 from mattyocode/dependabot/npm_and_yarn/tar-6.2.1 #102

Workflow file for this run

name: Build and deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
AWS_S3_BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
steps:
- uses: actions/checkout@v2
- name: Cache modules
uses: actions/cache@v1
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
- name: Build
run: yarn build
- name: Set bucket name
run: |
echo BUCKET="${{ env.AWS_S3_BUCKET_NAME }}" >> .env
- name: Deploy
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ env.AWS_S3_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: "build"