Update publish.yml

This commit is contained in:
Kevin Franklin Kim
2025-09-12 16:07:46 +02:00
committed by GitHub
parent 5449d6fd6b
commit 36b15221ea
+29 -20
View File
@@ -1,39 +1,48 @@
# https://docusaurus.io/docs/deployment#deploying-to-github-pages
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
name: publish
on:
push:
branches: [main]
permissions:
contents: write
jobs:
publish:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v5
with:
node-version: "20.x"
#- uses: webfactory/ssh-agent@v0.5.0
# with:
# ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
cache: yarn
- name: Release to GitHub Pages
working-directory: foomo
env:
#USE_SSH: true
GIT_USER: git
run: |
git config user.email "publisher@foomo.org"
git config user.name "gh-actions"
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
yarn install --frozen-lockfile
npm run deploy
- uses: actions/upload-pages-artifact@v3
with:
path: foomo/build
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4