Skip to content

Commit

Permalink
Migrate to actions-mn/deploy-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Nov 17, 2023
1 parent 4e6115b commit 7c02eee
Showing 1 changed file with 3 additions and 51 deletions.
54 changes: 3 additions & 51 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ concurrency:
permissions:
contents: read
pages: write
id-token: write
pull-requests: write

jobs:
build:
Expand All @@ -47,55 +45,9 @@ jobs:
destination: artifact

deploy-gh-pages:
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} # inputs.deploy-gh-pages == 'true' &&
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.pat_token || github.token }}
- uses: actions/download-artifact@v3
with:
name: github-pages
path: site
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: site
branch: gh-pages
clean-exclude: pr-preview
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}

deploy-gh-pages-preview:
if: ${{ github.event_name == 'pull_request' }} # inputs.deploy-gh-pages == 'true' &&
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Deploy to GitHub Pages
uses: actions-mn/deploy-pages@main
with:
token: ${{ secrets.pat_token || github.token }}
- uses: actions/download-artifact@v3
with:
name: github-pages
path: site
- uses: rossjrw/pr-preview-action@v1
with:
source-dir: site
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}

deploy-gh-pages-cleanup:
if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} # inputs.deploy-gh-pages == 'true' &&
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.pat_token || github.token }}
- uses: rossjrw/pr-preview-action@v1
with:
source-dir: .
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7c02eee

Please sign in to comment.