Skip to content

Revert "actions-mn/build-and-publish#4 test preview pages deployment" #209

Revert "actions-mn/build-and-publish#4 test preview pages deployment"

Revert "actions-mn/build-and-publish#4 test preview pages deployment" #209

Workflow file for this run

name: docker
on:
push:
branches: [ master, main ]
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths-ignore:
- .gitlab-ci.yml
- .github/workflows/test.yml
- .github/workflows/generate.yml
- .github/workflows/automerge.yml
repository_dispatch:
types: [ metanorma/metanorma-docker ]
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
jobs:
build:
if: ${{ github.event.action != 'closed' }}
runs-on: ubuntu-latest
container:
image: metanorma/metanorma # ${{ inputs.docker-image }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.pat_token || github.token }}
submodules: true
- name: Metanorma generate site
uses: actions-mn/build-and-publish@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
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
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 }}