Skip to content

Commit

Permalink
Push versions based on dates and release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
cruizba committed Jan 26, 2024
1 parent 2993445 commit 390bc8e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Generate version
run: |
VERSION=$(echo "${{ github.ref_name }}"
DATE=$(date +%Y%m%d%H%M%S)
echo "DATE_TAG=${VERSION}-${DATE}" >> $GITHUB_ENV
echo "TAG=${VERSION}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -26,20 +32,27 @@ jobs:
push: true
file: ubuntu-focal.Dockerfile
platforms: linux/amd64,linux/arm64
tags: cruizba/ubuntu-dind:focal-${{ github.ref_name }}
tags: >
cruizba/ubuntu-dind:focal-${{ env.TAG }},
cruizba/ubuntu-dind:focal-${{ env.DATE_TAG }}
- name: Ubuntu 22.04 - Build and push
uses: docker/build-push-action@v5
with:
push: true
file: ubuntu-jammy.Dockerfile
platforms: linux/amd64,linux/arm64
tags: cruizba/ubuntu-dind:jammy-${{ github.ref_name }},cruizba/ubuntu-dind:latest
tags: >
cruizba/ubuntu-dind:jammy-${{ env.TAG }},
cruizba/ubuntu-dind:jammy-${{ env.DATE_TAG }}
cruizba/ubuntu-dind:latest
- name: Ubuntu 24.04 - Build and push
uses: docker/build-push-action@v5
with:
push: true
file: ubuntu-noble.Dockerfile
platforms: linux/amd64,linux/arm64
tags: cruizba/ubuntu-dind:noble-${{ github.ref_name }}
tags: >
cruizba/ubuntu-dind:noble-${{ env.TAG }},
cruizba/ubuntu-dind:noble-${{ env.DATE_TAG }}

0 comments on commit 390bc8e

Please sign in to comment.