mirror of
https://github.com/cs341-illinois/coursebook.git
synced 2026-10-30 07:24:00 +08:00
55 lines
1.5 KiB
YAML
55 lines
1.5 KiB
YAML
name: Coursebook Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
build_focus: [WIKI, EPUB, PDF]
|
|
env:
|
|
BUILD_FOCUS: ${{ matrix.build_focus }}
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup python (3.7.17)
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7.17
|
|
#3.6.15
|
|
|
|
- name: Install
|
|
run: |
|
|
bash _scripts/install.sh
|
|
|
|
- name: Build coursebook
|
|
run: |
|
|
bash _scripts/script.sh
|
|
|
|
- name: Deploy site
|
|
run: |
|
|
# https://github.community/t/github-actions-bot-email-address/17204/6
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --global user.name "Github Actions Bot"
|
|
|
|
export COMMITTER_EMAIL="github-actions@github.com"
|
|
export AUTHOR_NAME="Github Actions"
|
|
|
|
# Needed to add the --no-tty --batch --yes flags to get gpg to work in Github Actions
|
|
# Based on this: https://discuss.circleci.com/t/error-sending-to-agent-inappropriate-ioctl-for-device/17465/3
|
|
gpg --no-tty --batch --yes --passphrase ${{ secrets.GPG_PASSPHRASE }} --output /tmp/deploy_site --decrypt site-deploy.enc
|
|
gpg --no-tty --batch --yes --passphrase ${{ secrets.GPG_PASSPHRASE }} --output /tmp/deploy_wiki --decrypt wiki-deploy.enc
|
|
|
|
eval "$(ssh-agent -s)"
|
|
chmod 600 /tmp/deploy_site
|
|
chmod 600 /tmp/deploy_wiki
|
|
|
|
bash _scripts/deploy.sh
|