-
-
Notifications
You must be signed in to change notification settings - Fork 4
104 lines (88 loc) · 3.63 KB
/
website.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: 🚧 Website MkDocs
on:
pull_request:
branches:
- master
paths:
- 'website/**'
- '.github/workflows/website.yml'
push:
branches:
- master
- website
paths:
- 'website/**'
- '.github/workflows/website.yml'
workflow_dispatch: # useful for testing tx pushes
workflow_call: # call from release
defaults:
run:
working-directory: website
jobs:
website:
runs-on: ubuntu-latest
# Skip if this job was scheduled and the runner belongs to a fork (i.e. forks have no use for this action)
if: (github.event_name == 'schedule' && github.repository == 'opengisch/signalo') || (github.event_name != 'schedule')
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python requirements
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Install Python requirements insiders
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/signalo' }}
run: pip install -r requirements-insiders.txt
env:
GH_USER_INSIDER: ${{ secrets.GH_USER_INSIDER }}
GH_TOKEN_INSIDER: ${{ secrets.GH_TOKEN_INSIDER }}
- name: Install Transifex client
run: |
curl -OL https://github.com/transifex/cli/releases/download/v1.6.10/tx-linux-amd64.tar.gz
tar -xvzf tx-linux-amd64.tar.gz
- name: Extract translatable content from mkdocs.yml config
run: ./scripts/mkdocs_tx.py -s fr create_source
- name: Configure Transifex
run: scripts/transifex_utils.py
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Push source files to Transifex
if: ${{ github.event_name != 'pull_request' }}
run: ./tx push
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Pull translations from Transifex
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/signalo' }}
run: |
./tx pull --translations --all --minimum-perc 10
./tx status
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Translate Mkdocs config
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/signalo' }}
run: |
./scripts/mkdocs_tx.py -s fr update_config
./scripts/mkdocs_tx_commit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build documentation
run: mkdocs build
- name: Datamodel Documentation
run: |
LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/opengisch/signalo/releases/latest" | jq -r .tag_name)
wget -q https://github.com/opengisch/signalo/releases/download/${LATEST_RELEASE}/signalo-${LATEST_RELEASE}-model-documentation.zip
unzip -q signalo-${LATEST_RELEASE}-model-documentation.zip
cp -r model-documentation site/
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: website
path: website/site
if-no-files-found: error
- name: Deploy to GitHub Pages
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
run: ghp-import --push --force --no-jekyll site