finished #67
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout source | |
uses: actions/checkout@v4 | |
- name: setup nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- uses: pnpm/action-setup@v2 | |
name: install pnpm | |
id: pnpm-install | |
with: | |
version: latest | |
run_install: false | |
- name: get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: install deps | |
run: pnpm i | |
- name: run build | |
run: pnpm run build | |
# - name: run export | |
# run: pnpm run export | |
- name: run redirs | |
run: pnpm run redirs | |
- name: deploy website | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
uses: netlify/actions/cli@master | |
with: | |
args: deploy --prod --dir dist/ |