Skip to content

Commit

Permalink
Try and get web deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgodbolt committed Feb 18, 2021
1 parent 1d22fac commit 7f8d0a3
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: [ push ]
jobs:
build-and-test:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -36,7 +35,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-20.04]
os: [ macos-latest, windows-latest, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
Expand All @@ -59,3 +58,35 @@ jobs:
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"), release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}

update-web:
needs: build-and-test
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build distribution
run: |
make dist
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --cache-control max-age=30 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: s3://bbc.godbolt.org/
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'out/dist'

0 comments on commit 7f8d0a3

Please sign in to comment.