Removed complex "Extract metadata" tagging which was causing build failures. Replaced it with simpler but still effective method.
This commit is contained in:
parent
cb9cff4421
commit
64a70357eb
1 changed files with 2 additions and 15 deletions
17
.github/workflows/build-and-deploy.yml
vendored
17
.github/workflows/build-and-deploy.yml
vendored
|
|
@ -2,14 +2,12 @@
|
||||||
|
|
||||||
name: Build and Deploy
|
name: Build and Deploy
|
||||||
|
|
||||||
# This workflow runs only on pushes to the 'main' branch
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
# Set permissions for the job to read contents and write to GitHub Packages
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
@ -28,26 +26,16 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# --- NEW STEP TO FIX THE CACHING ERROR ---
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
ghcr.io/${{ github.repository }}/web-app
|
|
||||||
ghcr.io/${{ github.repository }}/rust-engine
|
|
||||||
|
|
||||||
# --- Build and push one image for each service ---
|
# --- Build and push one image for each service ---
|
||||||
- name: Build and push web-app image 🚀
|
- name: Build and push web-app image 🚀
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./web-app
|
context: ./web-app
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags_web-app }}
|
tags: ghcr.io/${{ github.repository }}/web-app:${{ github.sha }}
|
||||||
labels: ${{ steps.meta.outputs.labels_web-app }}
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
|
@ -56,8 +44,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: ./rust-engine
|
context: ./rust-engine
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags_rust-engine }}
|
tags: ghcr.io/${{ github.repository }}/rust-engine:${{ github.sha }}
|
||||||
labels: ${{ steps.meta.outputs.labels_rust-engine }}
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue