From 02d8a72bd03e23e9bb49050de98759246a1ca43e Mon Sep 17 00:00:00 2001 From: ndsboy Date: Mon, 24 Feb 2025 22:19:10 +0000 Subject: [PATCH] feat: reusable deployment --- .forgejo/workflows/deploy.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index a6d009a..48d3296 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -2,21 +2,29 @@ name: deploy on: [push, workflow_dispatch] env: - STORAGE_DRIVER: vfs + repo: documents + git: git.swablab.de + url: git.swablab.de/${{ github.repository }} + token: ${{ secrets.SWABLAB_ORGA_PACKAGE_TOKEN }} jobs: deploy: name: deploy runs-on: docker + if: github.ref == 'refs/heads/main' container: image: quay.io/buildah/stable:latest - if: github.ref == 'refs/heads/main' + env: + STORAGE_DRIVER: vfs steps: + - name: download + run: curl https://${{ env.url }}/archive/main.tar.gz | tar -xz + - name: login - run: buildah login -u token -p ${{ secrets.SWABLAB_ORGA_PACKAGE_TOKEN }} git.swablab.de + run: buildah login -u token -p ${{ env.token }} ${{ env.git }} - name: build - run: buildah build -t git.swablab.de/${{ github.repository }}:latest ${{ github.server_url }}/${{ github.repository }}.git + run: buildah build -f ${{ env.repo }}/Containerfile -t ${{ env.url }}:latest ${{ env.repo }} - name: push - run: buildah push git.swablab.de/${{ github.repository }}:latest + run: buildah push ${{ env.git }}/${{ github.repository }}:latest