Skip to content

Instantly share code, notes, and snippets.

@nikolaymatrosov
Created April 21, 2020 17:09
Show Gist options
  • Save nikolaymatrosov/a0e06c6c14107d4dc9d0b62c2dff0a0a to your computer and use it in GitHub Desktop.
Save nikolaymatrosov/a0e06c6c14107d4dc9d0b62c2dff0a0a to your computer and use it in GitHub Desktop.
Github Action to build and publish static Gatsby site
name: Gatsby Build and Publish
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- 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_S3_ENDPOINT: https://storage.yandexcloud.net
AWS_REGION: 'ru-central1'
SOURCE_DIR: 'public'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment