Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate Zapdos website regeneration #153

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
branches:
- 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