Skip to content

Merge branch 'main' into deploy #361

Merge branch 'main' into deploy

Merge branch 'main' into deploy #361

Workflow file for this run

name: Smoketest
on:
push:
pull_request:
workflow_dispatch:
env:
NODE_VERSION: 18.x
jobs:
formatting:
runs-on: ubuntu-latest
name: Verify formatting
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: |
yarn install --immutable
- name: Verify formatting
run: yarn format:check
build:
name: Build site
runs-on: ubuntu-latest
needs: [formatting]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
with:
static_site_generator: gatsby
- name: Install dependencies
run: |
yarn install --immutable
- name: Restore Gatsby cache
uses: actions/cache@v3
id: gatsbyCache
with:
path: ./.cache
key: ${{ runner.os }}-gatsby-cache-${{ secrets.CACHE_VERSION }}-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-cache-${{ secrets.CACHE_VERSION }}-
- name: Build site
run: yarn build:ci
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
with:
path: ./public
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1