From 351de8f208f9eaf1c4f49f09ec7884f65b872384 Mon Sep 17 00:00:00 2001 From: Alexande B Date: Wed, 6 Sep 2023 15:19:59 +0200 Subject: [PATCH] cimas: fix broken configuration for pages deploy request-checks: true --- .github/workflows/automerge.yml | 31 +++++++++++++++++++++ .github/workflows/docker.yml | 49 +++++++++++++++++++++++++-------- .github/workflows/generate.yml | 38 +++++++++++++++++++------ 3 files changed, 97 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..d794da37 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,31 @@ +# Auto-generated by Cimas: Do not edit it manually! +# See https://github.com/metanorma/cimas +# source: https://github.com/marketplace/actions/merge-pull-requests#usage +name: automerge +on: + pull_request: + types: + - labeled + - unlabeled + - synchronize + - opened + - edited + - ready_for_review + - reopened + - unlocked + pull_request_review: + types: + - submitted + check_suite: + types: + - completed + status: {} +jobs: + automerge: + runs-on: ubuntu-latest + steps: + - id: automerge + name: automerge + uses: "pascalgn/automerge-action@v0.15.6" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7bf81f9c..27b8816e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,19 +4,44 @@ name: docker on: push: - branches: [ master, main ] + branches: [ main ] pull_request: - paths-ignore: - - .gitlab-ci.yml - - .github/workflows/test.yml - - .github/workflows/generate.yml - repository_dispatch: - types: [ metanorma/metanorma-docker ] workflow_dispatch: +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: - test-docker: - uses: metanorma/ci/.github/workflows/sample-docker.yml@main - secrets: - pat_username: metanorma-ci - pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} + build: + runs-on: ubuntu-latest + container: + image: metanorma/metanorma:latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Metanorma generate site + uses: actions-mn/build-and-publish@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + agree-to-terms: true + + deploy: + if: ${{ github.ref_name == github.event.repository.default_branch }} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 62818602..2fad7994 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -4,16 +4,36 @@ name: generate on: push: - branches: [ master, main ] + branches: [ main ] pull_request: - paths-ignore: - - .gitlab-ci.yml - - .github/workflows/test.yml - - .github/workflows/docker.yml workflow_dispatch: jobs: - test-docker: - uses: metanorma/ci/.github/workflows/sample-gen.yml@main - secrets: - pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} + site-generate: + name: Generate on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + concurrency: + group: '${{ github.workflow }}-${{ matrix.os }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Cache Metanorma assets + uses: actions-mn/cache@v1 + + - name: Setup Metanorma toolchain + uses: actions-mn/setup@main + + - name: Metanorma generate site + uses: actions-mn/build-and-publish@v1 + with: + agree-to-terms: true + destination: artifact + artifact-name: ${{ github.event.repository.name }}-${{ runner.os }}