fix publish
Build and Publish Docker Image / build (push) Successful in 26s
Build and Publish Docker Image / deploy (push) Successful in 2s

This commit is contained in:
2026-09-07 14:34:17 -04:00
parent ec7b546645
commit bd381fbed2
+10 -19
View File
@@ -5,35 +5,26 @@ on:
branches: [main] branches: [main]
workflow_dispatch: workflow_dispatch:
env:
IMAGE: git.alexav.gg/${{ gitea.repository }}
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Build Docker Image
run: |
docker build -t git.alexav.gg/${{ gitea.repository }}:latest .
docker build -t git.alexav.gg/${{ gitea.repository }}:${{ gitea.sha }} .
- name: Login to Gitea Registry - name: Login to Gitea Registry
run: | run: |
echo "${{ secrets.RUNNER_TOKEN }}" \ echo "${{ secrets.RUNNER_TOKEN }}" | docker login git.alexav.gg -u ${{ gitea.actor }} --password-stdin
| docker login git.alexav.gg -u "${{ gitea.actor }}" --password-stdin
# The Dockerfile has two runnable stages and no sensible default: an - name: Push Docker Image
# untargeted build produces the last one (frontend) on its own, which
# then has nothing to proxy /api to. Both get published separately.
- name: Build and push
run: | run: |
for target in backend frontend; do docker push git.alexav.gg/${{ gitea.repository }}:latest
docker build --target "$target" \ docker push git.alexav.gg/${{ gitea.repository }}:${{ gitea.sha }}
-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: deploy:
needs: build needs: build