Skip to content

Commit eae453f

Browse files
authored
Merge pull request #20 from bpython/use-github-actions
2 parents 03c1331 + 4d05f8a commit eae453f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write # To push a branch
12+
pull-requests: write # To create a PR from that branch
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
submodules: recursive
18+
- name: Install pelican
19+
run: |
20+
python3 -m venv venv
21+
./venv/bin/pip install -U pip
22+
./venv/bin/pip install pelican
23+
- name: Deploy GitHub Pages
24+
run: |
25+
# This assumes your book is in the root of your repository.
26+
# Just add a `cd` here if you need to change to another directory.
27+
./venv/bin/pelican
28+
git worktree add gh-pages
29+
git config user.name "Deploy from CI"
30+
git config user.email ""
31+
cd gh-pages
32+
# Delete the ref to avoid keeping history.
33+
git update-ref -d refs/heads/gh-pages
34+
rm -rf *
35+
mv ../output/* .
36+
echo 'bpython-interpreter.org' > CNAME
37+
git add .
38+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
39+
git push --force --set-upstream origin gh-pages

0 commit comments

Comments
 (0)