-
-
Notifications
You must be signed in to change notification settings - Fork 812
66 lines (61 loc) · 1.91 KB
/
publish.yml
File metadata and controls
66 lines (61 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Publish
on:
push:
branches:
- lektor
jobs:
publish:
name: Publish site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Configure git
run: |
git config --local user.email "$(git log --pretty='%ae' -1)"
git config --local user.name "brutusthebee[bot]"
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade setuptools wheel
pip install -r requirements.txt
lektor plugins reinstall
sudo apt update -y
sudo apt install -y --no-install-recommends gettext
- name: Build site
run: |
lektor build --no-prune
- name: Translation update required?
id: updated
run: |
if [[ $(git status --porcelain) ]]; then
echo "updated=true" >> ${GITHUB_OUTPUT}
else
echo "updated=false" >> ${GITHUB_OUTPUT}
fi
- name: Commit updated translations
if: steps.updated.outputs.updated == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
# Commit the updated PO files.
git add i18n
git commit -m "Update translations to $(git rev-parse --short HEAD)."
git push origin
- name: Publish site
if: steps.updated.outputs.updated == 'false'
env:
LEKTOR_DEPLOY_USERNAME: brutusthebee
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.LEKTOR_DEPLOY_PASSWORD }}
run: |
lektor deploy ghpages-https
# This step is only needed if you're trying to diagnose test failures that
# only occur in CI, and can't be reproduced locally. When it runs, it will
# open an SSH server (URL reported in the logs) so you can ssh into the CI
# machine.
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: failure()