From 80877a026d494a048ed61d61602644f653cadc57 Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Mon, 7 Sep 2026 14:05:49 -0400 Subject: [PATCH] fix --- .gitea/workflows/build-and-publish.yml | 45 ++++++++++++++------------ .gitea/workflows/deploy.yml | 18 +++++++---- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/build-and-publish.yml b/.gitea/workflows/build-and-publish.yml index 1d5fac2..4f7cbc3 100644 --- a/.gitea/workflows/build-and-publish.yml +++ b/.gitea/workflows/build-and-publish.yml @@ -5,37 +5,40 @@ on: branches: [main] workflow_dispatch: +env: + IMAGE: git.alexav.gg/${{ gitea.repository }} + jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Login to Gitea Registry + run: | + echo "${{ secrets.RUNNER_TOKEN }}" \ + | docker login git.alexav.gg -u "${{ secrets.REGISTRY_USER }}" --password-stdin # The Dockerfile has two runnable stages and no sensible default: an # untargeted build produces the last one (frontend) on its own, which # then has nothing to proxy /api to. Both get published separately. - - name: Build Docker Images + - name: Build and push run: | - docker build --target backend \ - -t git.alexav.gg/${{ gitea.repository }}:backend-latest \ - -t git.alexav.gg/${{ gitea.repository }}:backend-${{ gitea.sha }} . - docker build --target frontend \ - -t git.alexav.gg/${{ gitea.repository }}:frontend-latest \ - -t git.alexav.gg/${{ gitea.repository }}:frontend-${{ gitea.sha }} . - - - name: Login to Gitea Registry - run: | - echo "${{ secrets.RUNNER_TOKEN }}" | docker login git.alexav.gg -u ${{ gitea.actor }} --password-stdin - - - name: Push Docker Images - run: | - docker push git.alexav.gg/${{ gitea.repository }}:backend-latest - docker push git.alexav.gg/${{ gitea.repository }}:backend-${{ gitea.sha }} - docker push git.alexav.gg/${{ gitea.repository }}:frontend-latest - docker push git.alexav.gg/${{ gitea.repository }}:frontend-${{ gitea.sha }} + for target in backend frontend; do + docker build --target "$target" \ + -t "$IMAGE:$target-latest" \ + -t "$IMAGE:$target-$GITEA_SHA" . + docker push "$IMAGE:$target-latest" + docker push "$IMAGE:$target-$GITEA_SHA" + done + env: + GITEA_SHA: ${{ gitea.sha }} deploy: + needs: build + runs-on: ubuntu-latest steps: - - name: Deploy - uses: alex/blog/.github/workflows/deploy.yml + - uses: https://git.alexav.gg/alex/deploy-action@v1 + with: + token: ${{ secrets.RUNNER_TOKEN }} diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 879b0da..e96deda 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,9 +1,15 @@ -name: Deploy action +name: Deploy blog on: workflow_call: + secrets: + RUNNER_TOKEN: + required: true -run: - - uses: https://git.alexav.gg/alex/deploy-action@v1 - with: - task: blog_deploy - token: ${{ secrets.RUNNER_TOKEN }} +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: https://git.alexav.gg/alex/deploy-action@v1 + with: + task: blog_deploy + token: ${{ secrets.RUNNER_TOKEN }}