Refactor build workflow to separate backend and frontend image builds; enhance clarity and structure
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 36s

This commit is contained in:
2026-01-23 22:10:25 -05:00
parent 74d6f5819c
commit cd9070ec99

View File

@@ -15,7 +15,7 @@ jobs:
- name: Determine Image Tag
id: vars
run: |
run: |
if [ "${{ gitea.ref }}" == "refs/heads/master" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
@@ -26,11 +26,15 @@ jobs:
id: gitea_ip
run: |
ip=$(getent hosts gitea-server | awk '{ print $1 }')
echo "ip=$ip" >> $GITHUB_OUTPUT
echo "ip=$ip" >> $GITHUB_OUTPUT
- name: Build Docker Image
- name: Build Backend Docker Image
run: |
docker build -t ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/chore:${{ steps.vars.outputs.tag }} .
docker build -t ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:${{ steps.vars.outputs.tag }} ./backend
- name: Build Frontend Docker Image
run: |
docker build -t ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:${{ steps.vars.outputs.tag }} ./frontend/vue-app
- name: Log in to Registry
uses: docker/login-action@v2
@@ -39,6 +43,10 @@ jobs:
username: ryan #${{ secrets.REGISTRY_USERNAME }} # Stored as a Gitea secret
password: 0x013h #${{ secrets.REGISTRY_TOKEN }} # Stored as a Gitea secret (use a PAT here)
- name: Push Image to Gitea Registry
- name: Push Backend Image to Gitea Registry
run: |
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/chore:${{ steps.vars.outputs.tag }}
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:${{ steps.vars.outputs.tag }}
- name: Push Frontend Image to Gitea Registry
run: |
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:${{ steps.vars.outputs.tag }}