fix ci
This commit is contained in:
parent
faa9089e7a
commit
886a11cfbc
2 changed files with 45 additions and 21 deletions
|
@ -3,55 +3,77 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
SERVER_URL: ${{ vars.SERVER_URL }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# TODO: belongs in the other repo
|
# TODO: belongs in the other repo
|
||||||
build-latex:
|
build-latex:
|
||||||
name: Build LaTeX documents
|
name: Build LaTeX documents
|
||||||
runs-on: alpine:edge
|
runs-on: alpine
|
||||||
|
# for some reason this is required to make Forgejo Actions realize we don’t have bash in alpine
|
||||||
|
container:
|
||||||
|
image: alpine:edge
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: ash -eo pipefail {0}
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: apk add nodejs git openssh texlive texlive-xetex texmf-dist-latexrecommended texmf-dist-latexextra texmf-dist-langgerman
|
run: apk add --no-cache nodejs git openssh texlive texlive-xetex texmf-dist-latexrecommended texmf-dist-latexextra texmf-dist-langgerman
|
||||||
- name: Checkout LaTeX repository
|
- name: Checkout LaTeX repository
|
||||||
uses: actions/checkout@v4
|
run: git clone https://git.p-schwarz.de/ctbk/ctbk-satzung.git satzung
|
||||||
with:
|
# uses: actions/checkout@v4
|
||||||
# todo: repo path
|
|
||||||
repository: https://git.p-schwarz.de/ctbk/ctbk-satzung
|
|
||||||
- name: Clone main repo for scripts
|
- name: Clone main repo for scripts
|
||||||
run: git clone ${{ github.repository }} website
|
run: git clone https://github.com/${{ github.repository }} website
|
||||||
- run: mkdir build output
|
- run: mkdir satzung/build satzung/output
|
||||||
|
|
||||||
|
- name: Make LaTeX script executable
|
||||||
|
run: chmod +x website/.forgejo/workflows/latex.sh
|
||||||
- name: Build Satzung
|
- name: Build Satzung
|
||||||
run: website/.forgejo/workflows/latex.sh Satzung.tex build
|
working-directory: satzung
|
||||||
|
run: ../website/.forgejo/workflows/latex.sh Satzung.tex build
|
||||||
- name: Build Geschäftsordnung
|
- name: Build Geschäftsordnung
|
||||||
run: website/.forgejo/workflows/latex.sh Geschaeftsordnung.tex build
|
working-directory: satzung
|
||||||
|
run: ../website/.forgejo/workflows/latex.sh Geschaeftsordnung.tex build
|
||||||
- name: Build Gebührenordnung
|
- name: Build Gebührenordnung
|
||||||
run: website/.forgejo/workflows/latex.sh Gebuehrenordnung.tex build
|
working-directory: satzung
|
||||||
|
run: ../website/.forgejo/workflows/latex.sh Gebuehrenordnung.tex build
|
||||||
- name: Build Mitgliedsantrag
|
- name: Build Mitgliedsantrag
|
||||||
working-directory: Mitgliedsantrag-main
|
working-directory: satzung/Mitgliedsantrag-main
|
||||||
run: ../website/.forgejo/workflows/latex.sh Mitgliedsantrag_Lastschriftmandat_klein.tex ../build
|
run: ../../website/.forgejo/workflows/latex.sh Mitgliedsantrag_Lastschriftmandat_klein.tex ../build
|
||||||
- name: Build Mitgliedsantrag Fördermitglied
|
- name: Build Mitgliedsantrag Fördermitglied
|
||||||
working-directory: Mitgliedsantrag-main
|
working-directory: satzung/Mitgliedsantrag-main
|
||||||
run: ../website/.forgejo/workflows/latex.sh Mitgliedsantrag_Foerder_Lastschriftmandat.tex ../build
|
run: ../../website/.forgejo/workflows/latex.sh Mitgliedsantrag_Foerder_Lastschriftmandat.tex ../build
|
||||||
|
|
||||||
- name: Move PDFs to output directory
|
- name: Move PDFs to output directory
|
||||||
|
working-directory: satzung
|
||||||
run: |
|
run: |
|
||||||
mv build/*.pdf output
|
mv build/*.pdf output
|
||||||
mv output/Mitgliedsantrag_Lastschriftmandat_klein.pdf output/Mitgliedsantrag.pdf
|
mv output/Mitgliedsantrag_Lastschriftmandat_klein.pdf output/Mitgliedsantrag.pdf
|
||||||
mv output/Mitgliedsantrag_Foerder_Lastschriftmandat.pdf output/Mitgliedsantrag_Foerder.pdf
|
mv output/Mitgliedsantrag_Foerder_Lastschriftmandat.pdf output/Mitgliedsantrag_Foerder.pdf
|
||||||
|
|
||||||
- name: Output SSH key to file
|
- name: Output SSH key to file
|
||||||
run: echo ${{ secrets.SSH_KEY }} > ssh_id
|
working-directory: satzung
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.SSH_KEY }}" > ssh_id
|
||||||
|
chmod 0600 ssh_id
|
||||||
- name: Transfer built files
|
- name: Transfer built files
|
||||||
run: scp -i ssh_id -o StrictHostKeyChecking=accept-new -r ./output/ ${{ vars.SERVER_URL }}/docs
|
working-directory: satzung
|
||||||
|
run: scp -i ssh_id -o StrictHostKeyChecking=accept-new -r ./output/. ${{ env.SERVER_URL }}/docs
|
||||||
|
|
||||||
build-website:
|
build-website:
|
||||||
name: Build and deploy website
|
name: Build and deploy website
|
||||||
# needs:
|
# needs:
|
||||||
# - build-latex
|
# - build-latex
|
||||||
runs-on: alpine:edge
|
runs-on: alpine
|
||||||
|
container:
|
||||||
|
image: alpine:edge
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: ash -eo pipefail {0}
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: apk add curl nodejs git zola openssh minify texlive
|
run: apk add --no-cache curl nodejs git zola openssh minify
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
@ -61,6 +83,8 @@ jobs:
|
||||||
run: minify --all -r -o . public
|
run: minify --all -r -o . public
|
||||||
|
|
||||||
- name: Output SSH key to file
|
- name: Output SSH key to file
|
||||||
run: echo ${{ secrets.SSH_KEY }} > ssh_id
|
run: |
|
||||||
|
echo "${{ secrets.SSH_KEY }}" > ssh_id
|
||||||
|
chmod 0600 ssh_id
|
||||||
- name: Transfer built files
|
- name: Transfer built files
|
||||||
run: scp -i ssh_id -o StrictHostKeyChecking=accept-new -r ./public/ ${{ vars.SERVER_URL }}
|
run: scp -i ssh_id -o StrictHostKeyChecking=accept-new -r ./public/. ${{ env.SERVER_URL }}
|
||||||
|
|
0
.forgejo/workflows/latex.sh
Normal file → Executable file
0
.forgejo/workflows/latex.sh
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue