Skip to content

ci: improve deploy page workflow #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ concurrency:
cancel-in-progress: true

jobs:
should-deploy:
name: Check if should deploy page
runs-on: ubuntu-lastest
if: github.event_name == 'push' || contains(github.ref, '/heads/master')
steps:
- name: Write output
run: echo "deploy=true" >> "$GITHUB_OUTPUT"

lint:
name: Lint
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,14 +41,15 @@ jobs:
cache: yarn
- name: Install dependencies
run: yarn --immutable
- name: Run typechecking
- name: Typecheck
continue-on-error: true
run: yarn run typecheck

build:
name: Build
runs-on: ubuntu-latest
needs: lint
needs:
- lint
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -72,10 +65,10 @@ jobs:
cache: yarn
- name: Install dependencies
run: yarn --immutable
- name: Building
- name: Build
run: yarn run generate
- name: Upload artifact
if: ${{ steps.should-deploy.outputs.deploy }}
if: ${{ github.event_name == 'push' || contains(github.ref, '/heads/master') }}
uses: actions/upload-pages-artifact@v3
with:
path: .output/public
Expand All @@ -85,7 +78,7 @@ jobs:
runs-on: ubuntu-lastest
needs:
- build
- should-deploy
if: ${{ github.event_name == 'push' || contains(github.ref, '/heads/master') }}
steps:
- name: Deploy artifact to GitHub Pages
uses: actions/deploy-pages@v4