update gh actions

This commit is contained in:
Jacky Zhao 2023-06-07 10:52:53 -07:00
parent 1cb4dadf13
commit dde36fa558
2 changed files with 40 additions and 8 deletions

View File

@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
on: on:
push: push:
branches: branches:
- v4-alpha - v4-alpha # TODO: update
jobs: jobs:
deploy: deploy:
@ -18,7 +18,7 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: '18' node-version: 18
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v3 uses: actions/cache@v3
@ -31,10 +31,11 @@ jobs:
- run: npm ci - run: npm ci
- name: Build Quartz - name: Build Quartz
run: npx quartx build run: npx quartz build
- name: Deploy # TODO: when we actually release
uses: peaceiris/actions-gh-pages@v3 # - name: Deploy
with: # uses: peaceiris/actions-gh-pages@v3
github_token: ${{ secrets.GITHUB_TOKEN }} # with:
publish_dir: ./public # github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public

31
.github/workflows/publish.yaml vendored Normal file
View File

@ -0,0 +1,31 @@
name: publish
on:
push:
branches:
- v4-alpha # TODO: update
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- id: publish-cli
name: Publish @jackyzha0/quartz
uses: JS-DevTools/npm-publish@v2
with:
package: ./package.json
token: ${{ secrets.NPM_AUTH_TOKEN }}
strategy: upgrade
access: public
- if: steps.publish-cli.outputs.type != 'none'
run: |
echo "Version of @jackyzha0/quartz changed: ${{ steps.publish-cli.outputs.old-version }} => ${{ steps.publish-cli.outputs.version }}"