Skip to content

Commit

Permalink
Add latest/latest-dev tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hoetmaaiers committed Jun 26, 2024
1 parent fff3110 commit 02bb3fe
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: ci

on:
push:
# branches:
# - 'main'
branches:
- 'main'
- 'develop'
- 'feature/github-actions'

jobs:
dockerhub-build-push:
Expand All @@ -25,12 +27,24 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Generate timestamp
id: timestamp
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Determine tag
id: tag
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
echo "::set-output name=tag::latest"
elif [[ ${{ github.ref }} == 'refs/heads/develop' ]]; then
echo "::set-output name=tag::latest-dev"
fi
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: vitobelgium/guppy:latest
tags: |
vitobelgium/guppy:${{ steps.tag.outputs.tag }}
vitobelgium/guppy:${{ env.TIMESTAMP }}
context: ./server
file: ./server/Dockerfile
cache-from: type=gha
Expand Down

0 comments on commit 02bb3fe

Please sign in to comment.