Skip to content

Commit

Permalink
Add GitHub actions workflow to regenerate Zapdos website after each p…
Browse files Browse the repository at this point in the history
…ush to master.

Refs #41
  • Loading branch information
cticenhour committed Dec 7, 2022
1 parent 9c3facd commit 1004b5e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/generate_website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Generate Zapdos Website

on:
push:
branch:
- master

jobs:
build-website:
runs-on: ubuntu-latest
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout Zapdos
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Mambaforge3 and Zapdos environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
use-mamba: true
activate-environment: zapdos
environment-file: scripts/conda_environment.yml
# Note for build step: GitHub-hosted runners are currently limited to 2 cores
# See: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
- name: Build Zapdos
run: |
conda activate zapdos
make -j2
# GITHUB_WORKSPACE contains the location of the repository when using the checkout action
# See: https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
- name: Build Zapdos documentation
run: |
cd doc
./moosedocs.py build --destination=$GITHUB_WORKSPACE/../zapdos-site
- name: Clean-up Zapdos
run: |
git submodule deinit -f moose crane squirrel
git clean -xfd
# GITHUB_SHA contains the commit SHA that triggered the workflow (the head commit of the master branch)
- name: Checkout gh-pages and push new website
run: |
git fetch origin gh-pages
git checkout gh-pages
rm -rf *
cd $GITHUB_WORKSPACE/../zapdos-site
rm test.html
mv * $GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE
git status
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Update zapdos website based on $GITHUB_SHA"
git push origin gh-pages
8 changes: 8 additions & 0 deletions scripts/conda_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This YML file is used within the Generate Zapdos Website action to setup the build environment for Zapdos.
# See .github/workflows/generate_website.yml
channels:
- https://conda.software.inl.gov/public
dependencies:
- python=3.10
- moose-libmesh
- moose-tools

0 comments on commit 1004b5e

Please sign in to comment.