diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3d532ea..ab80d34 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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