Skip to content

Commit

Permalink
Update docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Comand authored Oct 3, 2024
1 parent 16b5567 commit 509bcee
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ name: Build and Push Docker Image
on:
push:
tags:
- 'v*.*.*' # Triggers on version tags
workflow_dispatch: # Allows manual triggering

- 'v*.*.*' # Triggers on version tags
workflow_dispatch: # Allows manual triggering

jobs:
build:
Expand All @@ -15,9 +14,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build Docker Image
run: |
docker build -t ghcr.io/toomanyfiles/tmf-timetable-frontend .
docker build -t ghcr.io/toomanyfiles/tmf-timetable-frontend:${{ env.VERSION }} \
-t ghcr.io/toomanyfiles/tmf-timetable-frontend:latest .
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -26,6 +30,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Docker Image
- name: Push Docker Image with version and latest tags
run: |
docker push ghcr.io/toomanyfiles/tmf-timetable-frontend
docker push ghcr.io/toomanyfiles/tmf-timetable-frontend:${{ env.VERSION }}
docker push ghcr.io/toomanyfiles/tmf-timetable-frontend:latest

0 comments on commit 509bcee

Please sign in to comment.