Move website generation to GitHub Actions
This commit is contained in:
parent
2f1873d120
commit
95918cda88
6 changed files with 31 additions and 60 deletions
39
.github/deploy.sh
vendored
39
.github/deploy.sh
vendored
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
P="$(mktemp -d)"
|
|
||||||
mkdir "$P/git" "$P/out"
|
|
||||||
|
|
||||||
if [ "$encrypted_1671ba5f199a_key" ]
|
|
||||||
then
|
|
||||||
eval "$(ssh-agent -s)"
|
|
||||||
openssl aes-256-cbc -K "$encrypted_1671ba5f199a_key" \
|
|
||||||
-iv "$encrypted_1671ba5f199a_iv" \
|
|
||||||
-in .github/deploy_key.enc -out .github/deploy_key -d
|
|
||||||
chmod 600 .github/deploy_key
|
|
||||||
ssh-add .github/deploy_key
|
|
||||||
|
|
||||||
pip install git+https://github.com/spanezz/staticsite.git@v1.2
|
|
||||||
fi
|
|
||||||
|
|
||||||
git clone --depth=10 --branch=gh-pages "git@github.com:${TRAVIS_REPO_SLUG}.git" "$P/git"
|
|
||||||
|
|
||||||
rm -Rfv dosage.egg-info
|
|
||||||
ssite build --output "$P/out"
|
|
||||||
|
|
||||||
rsync -r --del --verbose --cvs-exclude --exclude-from .github/website-exclude \
|
|
||||||
"$P/out/" "$P/git"
|
|
||||||
|
|
||||||
cd "$P/git"
|
|
||||||
|
|
||||||
git config user.email 'nobody@23.gs'
|
|
||||||
git config user.name 'Travis-CI Website Bot'
|
|
||||||
git config push.default simple
|
|
||||||
|
|
||||||
git add -A .
|
|
||||||
if [ "$TRAVIS_COMMIT" ]
|
|
||||||
then
|
|
||||||
git commit -a -m "Update website from commit $TRAVIS_COMMIT" || true
|
|
||||||
git push origin HEAD:gh-pages
|
|
||||||
fi
|
|
||||||
|
|
BIN
.github/deploy_key.enc
vendored
BIN
.github/deploy_key.enc
vendored
Binary file not shown.
1
.github/deploy_key.pub
vendored
1
.github/deploy_key.pub
vendored
|
@ -1 +0,0 @@
|
||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/I1J2fVYFzxQP7cZK32kI28cv94NH0xdq08OoIfwpz website-autodeploy
|
|
12
.github/website-exclude
vendored
12
.github/website-exclude
vendored
|
@ -1,12 +0,0 @@
|
||||||
CNAME
|
|
||||||
Jenkinsfile
|
|
||||||
build
|
|
||||||
cc-test-reporter
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
dosage
|
|
||||||
dosagelib
|
|
||||||
scripts
|
|
||||||
setup.cfg
|
|
||||||
setup.py
|
|
||||||
tests
|
|
31
.github/workflows/pages.yml
vendored
Normal file
31
.github/workflows/pages.yml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
name: GitHub Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 10
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
pip install git+https://github.com/spanezz/staticsite.git@v1.2
|
||||||
|
ssite build --output public
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
cname: dosage.rocks
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
exclude_assets: 'Jenkinsfile,dosagelib,scripts,setup.*,tests,*.ini'
|
|
@ -30,11 +30,3 @@ notifications:
|
||||||
- "chat.freenode.net#dosage"
|
- "chat.freenode.net#dosage"
|
||||||
use_notice: true
|
use_notice: true
|
||||||
skip_join: true
|
skip_join: true
|
||||||
# Push site to gh-pages branch
|
|
||||||
deploy:
|
|
||||||
- provider: script
|
|
||||||
skip_cleanup: true
|
|
||||||
script: .github/deploy.sh
|
|
||||||
on:
|
|
||||||
branch: master
|
|
||||||
python: 3.9
|
|
||||||
|
|
Loading…
Reference in a new issue