diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 9f05f14..71db3fd 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -2,25 +2,30 @@ name: deploy on: [push, workflow_dispatch] env: + repo: website + git: git.swablab.de + url: git.swablab.de/${{ github.repository }} + token: ${{ secrets.SWABLAB_ORGA_PACKAGE_TOKEN }} ASTRO_TELEMETRY_DISABLED: true - STORAGE_DRIVER: vfs 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 ${{ 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 + run: curl https://${{ env.url }}/archive/main.tar.gz | tar -xz - name: build - run: buildah build -f website/Containerfile -t git.swablab.de/${{ github.repository }}:latest website + run: buildah build -f ${{ env.repo }}/Containerfile -t ${{ env.url }}:latest ${{ env.repo }} + + - name: login + run: buildah login -u token -p ${{ env.token }} ${{ env.git }} - name: push - run: buildah push git.swablab.de/${{ github.repository }}:latest + run: buildah push ${{ env.git }}/${{ github.repository }}:latest diff --git a/Containerfile b/Containerfile index 373fa28..29df794 100644 --- a/Containerfile +++ b/Containerfile @@ -4,9 +4,9 @@ ENV ASTRO_TELEMETRY_DISABLED=true RUN deno task install RUN deno task build -FROM ghcr.io/swablab/documents:latest AS documents +FROM git.swablab.de/swablab/documents AS documents -FROM docker.io/nginxinc/nginx-unprivileged:latest +FROM docker.io/nginxinc/nginx-unprivileged COPY ./nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build ./dist /usr/share/nginx/html COPY --from=documents / /usr/share/nginx/html/docs \ No newline at end of file