wip #380
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: "Publish" | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Setup Node.js environment" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: "Checkout branch: ${{ github.ref }}" | |
uses: actions/checkout@v2 | |
with: | |
path: master | |
fetch-depth: 0 # Fetch all history to get correct 'Last updated' information | |
- name: "Checkout branch: gh-pages" | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
fetch-depth: 0 | |
- name: "Clean install dependencies and build" | |
working-directory: master | |
## /home/runner/work/notes/notes/master | |
run: | | |
export NODE_OPTIONS=--openssl-legacy-provider | |
npm ci | |
npm run build | |
# node tools/post-process.js | |
- name: "Copy dist files" | |
## Need to specifiy a working-directory, otherwise it cannot find the path | |
working-directory: gh-pages | |
## /home/runner/work/notes/notes/gh-pages | |
run: | | |
git rm -r * | |
mv ../master/docs/.vuepress/dist/* . | |
- name: "Deploy" | |
working-directory: gh-pages | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git reset HEAD~ | |
git add -A | |
git commit -m "publish '${{ github.event.head_commit.message }}'" | |
git push -f |