Skip to content

Commit

Permalink
Add date to docker images tags
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Jun 13, 2024
1 parent cf33331 commit 74bd01c
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
types: [opened, reopened, synchronize]
workflow_dispatch:

env:
CURRENT_DATE: $(date +"%Y-%m-%d")

jobs:
tag-pr:
runs-on: ubuntu-latest
Expand All @@ -29,12 +32,20 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/dnum-mi/basegun/basegun-backend
tags: |
type=raw,value=${{ env.CURRENT_DATE }}
type=raw,value=${{ github.head_ref }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: ghcr.io/dnum-mi/basegun/basegun-backend:${{ github.head_ref }}
tags: ${{ steps.meta.outputs.tags }}

build-frontend:
name: Build Frontend
Expand All @@ -48,12 +59,20 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/dnum-mi/basegun/basegun-frontend
tags: |
type=raw,value=${{ env.CURRENT_DATE }}
type=raw,value=${{ github.head_ref }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: ghcr.io/dnum-mi/basegun/basegun-frontend:${{ github.head_ref }}
tags: ${{ steps.meta.outputs.tags }}

test-backend:
name: Test Backend
Expand Down

0 comments on commit 74bd01c

Please sign in to comment.