|
1 | | -# Auto-generated by Cimas: Do not edit it manually! |
2 | | -# See https://github.com/metanorma/cimas |
3 | 1 | name: docker |
4 | 2 |
|
5 | 3 | on: |
6 | 4 | push: |
7 | | - branches: [ master ] |
| 5 | + branches: [ main ] |
8 | 6 | pull_request: |
9 | | - paths-ignore: |
10 | | - - .github/workflows/macos.yml |
11 | | - - .github/workflows/ubuntu.yml |
12 | | - - .github/workflows/windows.yml |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + pages: write |
| 12 | + id-token: write |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} |
| 16 | + cancel-in-progress: true |
13 | 17 |
|
14 | 18 | jobs: |
15 | | - test-docker: |
| 19 | + build: |
16 | 20 | runs-on: ubuntu-latest |
17 | | - container: docker://metanorma/mn |
| 21 | + container: |
| 22 | + image: metanorma/metanorma:latest |
18 | 23 | steps: |
19 | | - - uses: actions/checkout@master |
20 | | - - name: Checkout submodules |
21 | | - shell: bash |
22 | | - run: | |
23 | | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" |
24 | | - git submodule sync --recursive |
25 | | - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 |
26 | | - - name: Setup fonts |
27 | | - run: | |
28 | | - # We need to do this to install mscorefonts |
29 | | - apt-add-repository -y contrib |
30 | | - apt-get update |
31 | | - echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections |
32 | | - apt-get install -y ttf-mscorefonts-installer |
33 | | - curl -Ls https://raw.githubusercontent.com/metanorma/vista-fonts-installer/master/vista-fonts-installer.sh | bash |
34 | | - - name: Install gems from local Gemfile |
35 | | - run: | |
36 | | - curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/gemfile-to-bundle-add.sh | bash |
37 | | - - name: Build document in the Metanorma container |
38 | | - env: |
39 | | - LC_ALL: C.UTF-8 |
40 | | - LANG: C.UTF-8 |
41 | | - LANGUAGE: C.UTF-8 |
42 | | - run: | |
43 | | - metanorma site generate . -c metanorma.yml |
44 | | - - uses: actions/upload-artifact@master |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + submodules: true |
| 28 | + |
| 29 | + - name: Bundler install |
| 30 | + uses: metanorma/ci/docker-gem-install@main |
| 31 | + |
| 32 | + - name: Metanorma generate site |
| 33 | + uses: actions-mn/build-and-publish@v2 |
45 | 34 | with: |
46 | | - name: site |
47 | | - path: site |
| 35 | + destination: gh-pages |
| 36 | + agree-to-terms: true |
| 37 | + use-bundler: true |
48 | 38 |
|
49 | | - deploy-gh-pages: |
50 | | - if: github.ref == 'refs/heads/master' |
| 39 | + deploy: |
| 40 | + if: ${{ github.ref_name == github.event.repository.default_branch }} |
| 41 | + environment: |
| 42 | + name: github-pages |
| 43 | + url: ${{ steps.deployment.outputs.page_url }} |
51 | 44 | runs-on: ubuntu-latest |
52 | | - needs: test-docker |
| 45 | + needs: build |
53 | 46 | steps: |
54 | | - - uses: actions/checkout@master |
55 | | - - uses: actions/download-artifact@v1 |
56 | | - with: |
57 | | - name: site |
58 | | - - name: Deploy to GH Pages |
59 | | - uses: peaceiris/actions-gh-pages@v3 |
60 | | - with: |
61 | | - deploy_key: ${{ secrets.GH_DEPLOY_KEY }} |
62 | | - publish_dir: ./site |
63 | | - force_orphan: true |
64 | | - user_name: ${{ github.actor }} |
65 | | - user_email: ${{ format('{0}@users.noreply.github.com', github.actor) }} |
66 | | - commit_message: "${{ format('Deploy to GitHub Pages: {0}', github.sha) }}" |
67 | | - - uses: kolpav/purge-artifacts-action@v1 |
68 | | - with: |
69 | | - token: ${{ secrets.GITHUB_TOKEN }} |
70 | | - expire-in: 0 |
| 47 | + - name: Deploy to GitHub Pages |
| 48 | + id: deployment |
| 49 | + uses: actions/deploy-pages@v4 |
0 commit comments