Deploy Gatsby Site #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Gatsby Site | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: gatsby-frontend | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Initialise Page-Data | |
run: | | |
chmod +x ./initialisePageData.sh | |
./initialisePageData.sh | |
- name: Build | |
run: | | |
yarn install --immutable | |
yarn build | |
env: | |
GRAPHCMS_ENDPOINT: ${{ secrets.GRAPHCMS_ENDPOINT }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-1 | |
- name: Deploy | |
uses: jonelantha/gatsby-s3-action@v1 | |
with: | |
dest-s3-bucket: 'redbarongames.co.uk' | |
cloudfront-id-to-invalidate: E2XQEMGZXIZWEW | |
public-source-path: ./gatsby-frontend/public/ |