Skip to content

Gatsby → Astro

Gatsby → Astro #667

Workflow file for this run

name: 'CI'
on:
push:
branches:
- main
pull_request:
branches:
- '**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLIC_TYPEKIT_ID: ${{ secrets.GATSBY_TYPEKIT_ID }}
PUBLIC_MAPBOX_ACCESS_TOKEN: ${{ secrets.GATSBY_MAPBOX_ACCESS_TOKEN }}
PUBLIC_UMAMI_SCRIPT_URL: ${{ secrets.GATSBY_UMAMI_SCRIPT_URL }}
PUBLIC_UMAMI_WEBSITE_ID: ${{ secrets.GATSBY_UMAMI_WEBSITE_ID }}
PUBLIC_INFURA_ID: ${{ secrets.GATSBY_INFURA_ID }}
PUBLIC_WALLETCONNECT_ID: ${{ secrets.GATSBY_WALLETCONNECT_ID }}
jobs:
lint:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: ['18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npm run lint
typecheck:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: ['18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npm run prebuild
- run: npm run typecheck
test-unit:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: ['18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npm run test:unit
- uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.os }}-${{ matrix.node }}
path: coverage/
test-e2e:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['18']
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run test:e2e
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: ['18']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Cache Astro build output
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/dist
key: ${{ matrix.os }}-${{ matrix.node }}-astro-build-${{ hashFiles('dist/**/*.html', 'dist/**/*.js', 'dist/**/*.css', 'dist/**/*.jpg') }}
restore-keys: ${{ matrix.os }}-${{ matrix.node }}-astro-build-
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v1
if: github.ref == 'refs/heads/main'
with:
name: dist-${{ matrix.os }}-${{ matrix.node }}
path: dist
coverage:
runs-on: ubuntu-latest
needs: [test-unit]
if: ${{ success() && github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: coverage-ubuntu-latest-18
- uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
deploy:
needs: [lint, typecheck, test-unit, test-e2e, build]
if: success() && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v1
with:
name: dist-ubuntu-latest-18
- name: Deploy to S3
run: npm run deploy:s3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}