diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..33d830c0 --- /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.3" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7bf81f9c..eb18bf24 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 + + - name: Cache Metanorma assets + uses: actions-mn/cache@v1 + + - name: Metanorma generate site + uses: actions-mn/build-and-publish@v1 + with: + 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..5fa37d51 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -4,16 +4,34 @@ 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 + + - 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 }}