Bump @babel/traverse from 7.18.8 to 7.25.6 in /docs #19
Workflow file for this run
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 gh-pages | |
on: | |
push: | |
paths: | |
- 'docs/**' | |
- '.github/workflows/hugo.yml' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
cache-dependency-path: 'docs/package-lock.json' | |
- name: Setup public worktree | |
run: cd docs && git worktree add public gh-pages | |
- name: Create a branch for pull request | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd docs/public | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
git push origin --delete gh-pages-github-action || true | |
git checkout -b gh-pages-github-action gh-pages | |
- name: Build pages | |
run: | | |
cd docs | |
npm install | |
npm run build | |
ls public | |
cd public && git status | |
- name: Deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd docs/public | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
git add --all | |
git status | |
git diff-index --quiet HEAD || git commit -m "Update gh-pages" && git push --set-upstream origin gh-pages-github-action |