diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index e137142b..69c53f30 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -2,15 +2,12 @@ name: Deploy documentation on: push: branches: - - ci - main - - dev - workflow_dispatch: + - docs-snapshot + workflow_dispatch: {} release: types: - released - - unpublished - - edited permissions: contents: read @@ -22,17 +19,36 @@ concurrency: cancel-in-progress: true jobs: - get_latest_release: - name: Get latest release - uses: bdunderscore/modular-avatar/.github/workflows/get-latest-release.yml@main + snapshot-docs: + name: Snapshot documentation + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v2 + # Run on releases only + if: ${{ github.event.release }} + with: + ref: ${{ github.ref }} + fetch-depth: 0 + fetch-tags: true + - name: Merge with existing branch + # Run on releases only + if: ${{ github.event.release }} + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@nadena.dev" + git merge -s ours origin/docs-snapshot + git push origin HEAD:docs-snapshot build-docs: name: Build documentation (latest release) - needs: - - get_latest_release uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main + needs: + - snapshot-docs with: - ref: ${{ needs.get_latest_release.outputs.latest_release_tag }} + ref: docs-snapshot build-docs-dev: name: Build documentation (main branch) diff --git a/.github/workflows/get-latest-release.yml b/.github/workflows/get-latest-release.yml deleted file mode 100644 index 0f683fc0..00000000 --- a/.github/workflows/get-latest-release.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This is isolated to its own workflow file to avoid leaking publish secrets into the -# github token -name: Get latest release -on: - workflow_call: - outputs: - latest_release_tag: - description: 'latest release tag' - value: ${{ jobs.get_latest_release.outputs.latest_release_tag }} -jobs: - get_latest_release: - name: Get latest release - runs-on: ubuntu-latest - steps: - - uses: pozetroninc/github-action-get-latest-release@v0.7.0 - id: latest_release - with: - repository: bdunderscore/modular-avatar - token: ${{ secrets.GITHUB_TOKEN }} - excludes: "prerelease, draft" - - run: echo "latest_release_tag=${{ steps.latest_release.outputs.release }}" - outputs: - latest_release_tag: ${{ steps.latest_release.outputs.release }} \ No newline at end of file