Skip to content

Commit

Permalink
Control versions from github yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
cruizba committed Jan 26, 2024
1 parent 390bc8e commit 35bf608
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ name: Build and push Docker image
on:
release:
types: [published]
workflow_dispatch:
env:
CURRENT_VERSION: 25.0.0
BUILD_NUMBER: 0

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 @@ -33,8 +31,8 @@ jobs:
file: ubuntu-focal.Dockerfile
platforms: linux/amd64,linux/arm64
tags: >
cruizba/ubuntu-dind:focal-${{ env.TAG }},
cruizba/ubuntu-dind:focal-${{ env.DATE_TAG }}
cruizba/ubuntu-dind:focal-${{ env.CURRENT_VERSION }},
cruizba/ubuntu-dind:focal-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }}
- name: Ubuntu 22.04 - Build and push
uses: docker/build-push-action@v5
Expand All @@ -43,8 +41,8 @@ jobs:
file: ubuntu-jammy.Dockerfile
platforms: linux/amd64,linux/arm64
tags: >
cruizba/ubuntu-dind:jammy-${{ env.TAG }},
cruizba/ubuntu-dind:jammy-${{ env.DATE_TAG }}
cruizba/ubuntu-dind:jammy-${{ env.CURRENT_VERSION }},
cruizba/ubuntu-dind:jammy-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }}
cruizba/ubuntu-dind:latest
- name: Ubuntu 24.04 - Build and push
Expand All @@ -54,5 +52,5 @@ jobs:
file: ubuntu-noble.Dockerfile
platforms: linux/amd64,linux/arm64
tags: >
cruizba/ubuntu-dind:noble-${{ env.TAG }},
cruizba/ubuntu-dind:noble-${{ env.DATE_TAG }}
cruizba/ubuntu-dind:noble-${{ env.CURRENT_VERSION }},
cruizba/ubuntu-dind:noble-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }}

0 comments on commit 35bf608

Please sign in to comment.