Skip to content

Commit

Permalink
cimas: make GitHub Actions workflow more clear for end users
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Sep 5, 2023
1 parent cc53028 commit db7eeff
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 21 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
49 changes: 37 additions & 12 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 27 additions & 9 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit db7eeff

Please sign in to comment.