Skip to content

Commit

Permalink
test workflow
Browse files Browse the repository at this point in the history
test workflow

update context

test workflow

try with all permissions

test workflow

fix

test workflow

test workflow

try frontend

update workflow

fix workflow

try with env

fix workflow
  • Loading branch information
coutug committed Oct 2, 2024
1 parent 23aac24 commit acb1b08
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAGS: |
type=sha,prefix=,suffix=-{{date 'X'}}
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=develop
type=semver,pattern={{raw}}
jobs:
ghcr:
Expand All @@ -21,20 +26,29 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
- name: Extract frontend metadata
id: meta-front
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend
tags: |
${{ env.TAGS }}
- name: Extract backend metadata
id: meta-back
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend
tags: |
type=sha,prefix=,suffix=-{{date 'X'}}
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=develop
Expand All @@ -44,12 +58,14 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ./frontend
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

push: true
tags: ${{ steps.meta-front.outputs.tags }}
labels: ${{ steps.meta-front.outputs.labels }}

- name: Build and push backend Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta-back.outputs.tags }}
labels: ${{ steps.meta-back.outputs.labels }}

0 comments on commit acb1b08

Please sign in to comment.