-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (74 loc) · 2.63 KB
/
deploy.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
name: Deploy Site using release branch
on:
push:
branches:
- main
env:
INPUT_DIR: ${{ github.workspace }}/website_2024/content
OUTPUT_DIR: ${{ github.workspace }}/docs
PELICAN_CONF: ${{ github.workspace }}/website_2024/publishconf.py
jobs:
merge-build:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
- name: Merge main into release branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git fetch --all --unshallow
git checkout release
git merge --no-ff -X theirs main -m "Merge main into release"
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: |
cd website_2024/themes/PyCon-Israel-Flex/
npm install
- name: Build project
run: |
cd website_2024/themes/PyCon-Israel-Flex/
npm run build
- name: Install dependencies for make html
run: sudo apt-get install make
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Generated spakers page
run: |
poetry run python speakers.py ${{ vars.PRETALX_EVENT_NAME }} -t ${{ vars.PRETALX_API_TOKEN }} -o website_2024/content/pages/speakers.md --verbose
- name: Build HTML
run: |
git rm -rf ${{ env.OUTPUT_DIR }}
cd website_2024/
poetry run pelican ${{ env.INPUT_DIR }} -o ${{ env.OUTPUT_DIR }} -s ${{ env.PELICAN_CONF }}
# - name: Copy output to /docs
# run: cp -r website_2024/output/* docs/
- name: Commit and push changes
run: |
cd ${{ github.workspace }}
git add ${{ env.OUTPUT_DIR }}
git commit -m "Update /docs with latest build"
git push origin release