Skip to content

fix: docker image name (#3) #6

fix: docker image name (#3)

fix: docker image name (#3) #6

Workflow file for this run

name: Release
permissions:
contents: write
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
versionning:
name: Versionning
runs-on: ubuntu-latest
outputs:
version: ${{ steps.snapshot.outputs.version }}
release: ${{ steps.release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Remove tag locally
# This is done so that codacy/git-version can compute the version of the images deployed on docker hub
run: |
git tag -d ${{ github.ref_name }}
- name: Compute branch for codacy
# This is the branch to give to codacy to compute the snapshot version
id: rev
run: |
export CURRENT_BRANCH=$(git describe --tags)
echo "current-branch=$CURRENT_BRANCH" >> $GITHUB_OUTPUT
- name: Generate Snapshot Version
id: snapshot
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: ${{ github.ref_name }}-pre
dev-branch: ${{ steps.rev.outputs.current-branch }}
- name: Generate Release Version
id: release
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: ${{ steps.rev.outputs.current-branch }}
dev-branch: main
- name: Put versions in step summary
run: |
echo SNAPSHOT => ${{ steps.snapshot.outputs.version }} >> $GITHUB_STEP_SUMMARY
echo RELASE => ${{ steps.release.outputs.version }} >> $GITHUB_STEP_SUMMARY
- name: Validate tag
run : test ${{ steps.release.outputs.version }} == ${{ github.ref_name }}
- name: Delete tag if invalid
if: failure() || cancelled()
run : git push origin -d ${{ github.ref_name }}
update-changelog:
runs-on: ubuntu-latest
needs:
- versionning
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
fetch-depth: 0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
with:
node-version: 18
- run: npx @aneoconsultingfr/order-github-release-notes
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
docker:
name: Docker image Build
runs-on: ubuntu-latest
needs:
- versionning
strategy:
fail-fast: false
matrix:
image:
- { path: pdc-update, name: armonik_pdc_update, platforms: "linux/amd64" }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_LOGIN }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: "${{ matrix.image.path }}/Dockerfile"
context: "${{ matrix.image.path }}"
platforms: "${{ matrix.image.platforms }}"
push: true
tags: |
dockerhubaneo/${{ matrix.image.name }}:${{ github.ref_name }}