Skip to content

Commit

Permalink
ci: 👷 replace special chars in docker image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Oct 7, 2024
1 parent a6cfbe3 commit 144751b
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- develop

# env:
# TAG: ${{ (github.head_ref || github.ref_name) | tr '/' '-' }}

jobs:
pre-commit-check:
name: Check pre-commit hooks
Expand Down Expand Up @@ -34,12 +37,19 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/dnum-mi/basegun/basegun-backend
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./backend
push: true
tags: ghcr.io/dnum-mi/basegun/basegun-backend:${{ github.head_ref || github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}

build-frontend:
name: Build Frontend
Expand All @@ -53,19 +63,24 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/dnum-mi/basegun/basegun-backend
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
tags: ghcr.io/dnum-mi/basegun/basegun-frontend:${{ github.head_ref || github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}


test-backend:
name: Test Backend
needs: build-backend
runs-on: ubuntu-latest
container:
image: ghcr.io/dnum-mi/basegun/basegun-backend:${{ github.head_ref || github.ref_name }}
image: ghcr.io/dnum-mi/basegun/basegun-backend:latest
env:
AWS_REGION: gra
AWS_DEFAULT_REGION: gra
Expand All @@ -80,7 +95,7 @@ jobs:
OIDC_JWKS_KID: cc413527-173f-5a05-976e-9c52b1d7b431
OIDC_CLIENT_ID: basegun
steps:
- run: cd /app && pytest
- run: "cd /app && pytest"
services:
mailpit:
image: axllent/mailpit
Expand Down

0 comments on commit 144751b

Please sign in to comment.