build-documents #651
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-documents | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
types: [opened, synchronize, ready_for_review] | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
container: docker://metanorma/mn | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install gems from local Gemfile | |
run: | | |
curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/gemfile-to-bundle-add.sh | bash | |
- name: Build document in the Metanorma container | |
env: | |
LC_ALL: C.UTF-8 | |
LANG: C.UTF-8 | |
LANGUAGE: C.UTF-8 | |
run: | | |
make clean all publish | |
working-directory: ./src | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: documents | |
path: ./src/documents | |
deploy-gh-pages: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
needs: build-docker | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Make a directory for the artifact | |
run: mkdir documents | |
- uses: actions/download-artifact@v4 | |
with: | |
name: documents | |
path: documents | |
- name: Deploy to GH Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.GH_DEPLOY_KEY }} | |
publish_dir: documents | |
publish_branch: nist-pages | |
force_orphan: true | |
enable_jekyll: true | |
user_name: ${{ github.actor }} | |
user_email: ${{ format('{0}@users.noreply.github.com', github.actor) }} | |
commit_message: "${{ format('Deploy to GitHub Pages: {0}', github.sha) }}" | |
- name: Display file structure | |
run: ls -R | |
- uses: kolpav/purge-artifacts-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
expire-in: 0 |