fix(deps): update nextjs monorepo to v16 #880
This file contains hidden or 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: | |
| - "**" | |
| - "!gh-pages" | |
| tags: | |
| - "**" | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: global-workflow-queue | |
| cancel-in-progress: false | |
| jobs: | |
| call-build: | |
| uses: ./.github/workflows/build.yml | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: call-build | |
| concurrency: | |
| group: deploy-gh-pages | |
| cancel-in-progress: false | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: build-out | |
| path: out | |
| - name: Set up Git config | |
| run: | | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Deploy to gh-pages | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | |
| TARGET_PATH="branches/${GITHUB_REF#refs/heads/}" | |
| elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| TARGET_PATH="tags/${GITHUB_REF#refs/tags/}" | |
| else | |
| echo "Not a branch or tag, skipping" | |
| exit 1 | |
| fi | |
| git clone --depth 1 --branch gh-pages "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages | |
| rm -rf "gh-pages/${TARGET_PATH}" | |
| mkdir -p "gh-pages/${TARGET_PATH}" | |
| cp -r out/* "gh-pages/${TARGET_PATH}/" | |
| cd gh-pages | |
| git add . | |
| if ! git diff --cached --quiet; then | |
| git commit -m "Deploy ${TARGET_PATH} from ${GITHUB_SHA}" | |
| git push | |
| else | |
| echo "No changes to deploy." | |
| fi |