Add files via upload #6960
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: Build and deploy | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.ref }} | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Lint | |
run: pnpm run pretty:check | |
- name: Build | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' | |
run: pnpm run build | |
- name: Run tests | |
run: pnpm run test | |
- name: Add build.txt | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' | |
run: | | |
git log --pretty=format:'%h' -n 1 > dist/build.txt | |
echo >> dist/build.txt | |
date +%F_%T >> dist/build.txt | |
# Disable Jekyll to prevent files starting with _ not working properly. | |
- name: Create .nojekyll | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' | |
run: | | |
touch dist/.nojekyll | |
- name: Deploy | |
if: github.ref == 'refs/heads/master' | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: dist # The folder the action should deploy. | |
single-commit: true | |
clean: true |