diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..0b7c56c --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: deploy +on: [push, workflow_dispatch] + +env: + STORAGE_DRIVER: vfs + +jobs: + deploy: + name: deploy + runs-on: docker + container: + image: quay.io/buildah/stable:latest + if: github.ref == 'refs/heads/main' + steps: + - name: download + run: curl ${{ github.server_url }}/${{ github.repository }}/archive/main.tar.gz | tar -xz + + - name: login + run: buildah login -u token -p ${{ secrets.SWABLAB_ORGA_PACKAGE_TOKEN }} git.swablab.de + + - name: build + run: buildah build -f documents/Containerfile -t git.swablab.de/${{ github.repository }}:latest documents + + - name: push + run: buildah push git.swablab.de/${{ github.repository }}:latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index b47412c..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Build PDFs - -on: - push: - branches: - - main - -jobs: - deploy: - name: 🚢 Deploy - runs-on: ubuntu-latest - env: - TYPST_FONT_PATHS: /usr/share/fonts - steps: - - uses: actions/checkout@v4 - - run: sudo apt install -y fonts-noto-core fonts-ubuntu - - - uses: typst-community/setup-typst@v3 - - run: typst c 3d-druck-agb.typ - - run: typst c beitragsordnung.typ - - run: typst c beleg.typ - - run: typst c datenschutz.typ - - run: typst c haftungsausschluss.typ - - run: typst c mitgliedsantrag.typ - - run: typst c satzung.typ - - run: typst c werkstatt-agb.typ - - run: typst c werkstatt-regeln.typ - - - name: build containerfile - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - image: ghcr.io/swablab/documents - base-image: scratch - tags: latest - content: | - *.pdf - - - name: Log in to ghcr.io - uses: redhat-actions/podman-login@v1 - with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - - - name: Push to ghcr.io - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: ghcr.io diff --git a/.gitignore b/.gitignore index 3b742f0..8922701 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.pdf *.yml *.png -!.github/** \ No newline at end of file +!.forgejo/** \ No newline at end of file diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..c0d3ebe --- /dev/null +++ b/Containerfile @@ -0,0 +1,16 @@ +FROM docker.io/library/alpine AS build +ENV TYPST_FONT_PATHS=. +RUN wget -O ubuntu.ttf https://cdn.jsdelivr.net/fontsource/fonts/ubuntu@latest/latin-400-normal.ttf &&\ + wget -O noto.ttf https://cdn.jsdelivr.net/fontsource/fonts/noto-sans@latest/latin-400-normal.ttf +RUN typst c 3d-druck-agb.typ &&\ + typst c beitragsordnung.typ &&\ + typst c beleg.typ &&\ + typst c datenschutz.typ &&\ + typst c haftungsausschluss.typ &&\ + typst c mitgliedsantrag.typ &&\ + typst c satzung.typ &&\ + typst c werkstatt-agb.typ &&\ + typst c werkstatt-regeln.typ + +FROM scratch +COPY --from=build *.pdf . \ No newline at end of file