@@ -26,14 +26,20 @@ jobs:
2626 quoted+=("\"$line\"")
2727 done
2828 str=$( IFS=$','; echo "${quoted[*]}" )
29- echo "versions=[$str]" >> $GITHUB_OUTPUT
29+ echo "versions=[\"main\", $str]" >> $GITHUB_OUTPUT
3030
31- compile-latest :
31+ compile :
3232 runs-on : ubuntu-latest
33+ needs : get-versions
34+ strategy :
35+ matrix :
36+ version : ${{ fromJSON(needs.get-versions.outputs.versions) }}
3337 steps :
3438
3539 - name : Check out code
3640 uses : actions/checkout@v4
41+ with :
42+ ref : ${{ matrix.version }}
3743
3844 - name : Set up Python 3.9
3945 uses : actions/setup-python@v2
@@ -55,68 +61,29 @@ jobs:
5561
5662 - name : Compile site
5763 run : |
58- python generate.py
64+ python generate.py ${{ matrix.version }}
5965
6066 - uses : stefanzweifel/git-auto-commit-action@v5
6167 with :
6268 commit_user_name : BookWyrm Bot
63- commit_message : deploy latest
69+ commit_message : deploy versions
6470 commit_author : BookWyrm Bot <joinbookwyrm@users.noreply>
6571
66- - name : Deploy to server
67- id : deploy-latest
72+ - name : Deploy latest to server
73+ if : ${{ matrix.version == 'main' }}
74+ id : deploy-versions
6875 uses : Pendect/action-rsyncer@v2.0.0
6976 env :
7077 DEPLOY_KEY : ${{secrets.DEPLOY_KEY}}
7178 with :
72- flags : ' -avzr --delete'
79+ flags : ' -avzr --delete --exclude="v*[0-9\.]/**" '
7380 options : ' '
7481 ssh_options : ' '
7582 src : ' site/'
7683 dest : ' mouse@docs.joinbookwyrm.com:/var/www/docs-bookwyrm/html'
7784
78- compile-versions :
79- runs-on : ubuntu-latest
80- needs : get-versions
81- strategy :
82- matrix :
83- version : ${{ fromJSON(needs.get-versions.outputs.versions) }}
84- steps :
85-
86- - name : Check out code
87- uses : actions/checkout@v4
88- with :
89- ref : ${{ matrix.version }}
90-
91- - name : Set up Python 3.9
92- uses : actions/setup-python@v2
93- with :
94- python-version : 3.9
95-
96- - name : Install Dev Dependencies
97- run : |
98- sudo apt-get install gettext
99-
100- - name : Install Python Dependencies
101- run : |
102- python -m pip install --upgrade pip
103- pip install -r requirements.txt
104-
105- - name : Process translations
106- run : |
107- ./bw-dev messages:update
108-
109- - name : Compile site
110- run : |
111- python generate.py ${{ matrix.version }}
112-
113- - uses : stefanzweifel/git-auto-commit-action@v5
114- with :
115- commit_user_name : BookWyrm Bot
116- commit_message : deploy versions
117- commit_author : BookWyrm Bot <joinbookwyrm@users.noreply>
118-
119- - name : Deploy to server
85+ - name : Deploy versions to server
86+ if : ${{ matrix.version != 'main' }}
12087 id : deploy-versions
12188 uses : Pendect/action-rsyncer@v2.0.0
12289 env :
0 commit comments