Build #1141
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
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | |
# | |
# SPDX-License-Identifier: BSD-2-Clause | |
# Build and deploy the site | |
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: '7 3 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Site | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- run: pip3 install -U camkes-deps | |
- run: sudo apt-get install doxygen | |
- run: sudo gem install bundler | |
- run: make build JEKYLL_ENV=production | |
- run: tar -cvf site.tar _site/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: site | |
path: site.tar | |
deploy: | |
if: ${{ github.repository_owner == 'seL4' && | |
(github.event_name == 'push' || github.event_name == 'schedule' || | |
github.event_name == 'workflow_dispatch') }} | |
needs: build | |
name: 'Deploy' | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
token: ${{ secrets.GH_TOKEN }} | |
# for removing files, we need to start fresh; this does not remove dot-files | |
- run: rm -rf * | |
- uses: actions/download-artifact@v3 | |
with: | |
name: site | |
- run: tar -xvf site.tar | |
- run: cp -a _site/* . | |
- run: rm -rf site.tar _site | |
# recreate CNAME file for GitHub; not included in generated site | |
- run: echo docs.sel4.systems > CNAME | |
# add/remove everything | |
- run: git add -A . | |
- run: git diff --cached | |
- run: git config user.name "CI" | |
- run: git config user.email [email protected] | |
- run: git commit -m "auto-deployed" | |
- run: git push |