blog: 2020-12-26 #25
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 | |
on: | |
repository_dispatch: | |
types: ["build"] | |
push: | |
tags-ignore: | |
- '*' | |
branches: | |
- master | |
issues: | |
types: [closed] | |
permissions: write-all | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
GH_REPO: ${{ secrets.GH_REPO }} | |
jobs: | |
main: | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: | |
- 3.10.4 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
path: master | |
# see https://github.com/actions/setup-python | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/setup-node@v3 | |
id: setup-node | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v2 | |
id: setup-pnpm | |
with: | |
version: 6.0.2 | |
- name: Install requirements | |
id: install-requirements | |
run: | | |
cd master | |
pip install PyGithub requests | |
cd ~ | |
- name: Export issue | |
id: export-issue | |
run: | | |
cd master | |
python3 .github/issue.py | |
cd ~ | |
- name: Export site | |
id: export-site | |
run: | | |
cd master | |
pnpm install | |
pnpm export | |
cd ~ | |
- name: Checkout GitHub Pages | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
ref: gh-pages | |
path: gh-pages | |
- name: Auto Commit | |
id: auto-commit | |
run: | | |
cp -r master/docs gh-pages | |
cd gh-pages | |
git config --global user.email "dylanninin@gmail.com" | |
git config --global user.name "Dylanninin" | |
if [[ `git status --porcelain` ]]; then | |
git add . | |
git commit -m "update post - skip ci" | |
git push origin gh-pages | |
else | |
echo "clean" | |
fi |