Skip to content

Commit 209aa28

Browse files
authored
Use github actions (#59)
use github actions for the page build (replacing travis-ci) note: does not work yet, needs more work on the key.
1 parent bc68690 commit 209aa28

File tree

2 files changed

+61
-3
lines changed

2 files changed

+61
-3
lines changed

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Update pages
2+
on: [push]
3+
4+
jobs:
5+
update-web:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-python@v2
10+
with:
11+
python-version: '3.8'
12+
- name: Publish pages to web
13+
shell: bash
14+
env:
15+
encrypted_54b6162b97cf_key: ${{ secrets.encrypted_key }}
16+
encrypted_54b6162b97cf_iv: ${{ secrets.encrypted_iv }}
17+
run: |
18+
# Only build the "source" branch ("master" = built, published pages,
19+
# this can't be changed for organization GitHub Pages)
20+
test ${GITHUB_REF##*/} == "source" || exit 0
21+
22+
# Install dependency
23+
pip install docutils
24+
25+
# Add git metadata
26+
git config user.name "Automated build"
27+
git config user.email "[email protected]"
28+
29+
# Build the pages
30+
make clean
31+
make
32+
33+
# Delete workflow for the output ("master") branch,
34+
# so GitHub won't even trigger a build for it.
35+
rm .github/workflows/main.yml
36+
git add --all .
37+
git commit -m "Automatically built pages at $(git rev-parse --short HEAD)" || exit 0
38+
39+
# travis/github_deploy_key.enc is an encrypted SSH key.
40+
# The keys for this key are stored with GitHub and are exposed in the
41+
# $encrypted... environment variables. (These are *not* available in pull request builds!)
42+
# The public key is set up as a deployment key in the GitHub repository.
43+
# The following document explains the process:
44+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
45+
openssl aes-256-cbc -K $encrypted_54b6162b97cf_key -iv $encrypted_54b6162b97cf_iv -in .travis/github_deploy_key.enc -out github_deploy_key -d
46+
47+
# Add the SSH key
48+
chmod 600 github_deploy_key
49+
eval `ssh-agent -s`
50+
ssh-add github_deploy_key
51+
52+
# Push changes to the *master* branch
53+
# Remember, this is building the *source* branch.
54+
git push --force [email protected]:borgbackup/borgbackup.github.io.git HEAD:master
55+
56+
# Kill SSH agent, get rid of the key (GitHub does that as well)
57+
kill $SSH_AGENT_PID
58+
shred -u github_deploy_key

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# www.borgbackup.org
22

3-
[![Build Status](https://travis-ci.org/borgbackup/borgbackup.github.io.svg?branch=source)](https://travis-ci.org/borgbackup/borgbackup.github.io)
3+
[![Build Status](https://github.com/borgbackup/borgbackup.github.io/workflows/Update%20pages/badge.svg)](https://github.com/borgbackup/borgbackup.github.io/actions)
44

55
This is the project web site of BorgBackup.
66

77
All pages are meant to load very quickly with few/no external resources. All pages are generated from rST.
88

9-
HTML files are **never** committed to this ("source") branch. Travis automatically updates
9+
HTML files are **never** committed to this ("source") branch. Github Actions automatically updates
1010
the published ("master") branch. **Therefore pull requests should be submitted only to the "source" branch.**
1111

1212
To locally preview changes, update the HTML after editing a rST file, run `make`.
@@ -30,7 +30,7 @@ https://borgbackup.readthedocs.io/en/latest/development.html#building-the-docs-w
3030

3131
## Setup
3232

33-
Travis builds the "source" branch, generates HTML, commits it and
33+
Github Actions builds the "source" branch, generates HTML, commits it and
3434
pushes it to the "master" branch with a GitHub deploy key.
3535

3636
GitHub Pages is used as the host, TLS cert comes from LetsEncrypt (via GitHub).

0 commit comments

Comments
 (0)