ci: Update build-base-app.yml with image versioning

This commit is contained in:
Nicolas Giard 2024-10-28 22:10:40 -04:00 committed by GitHub
parent 9c37f52ee5
commit 50d4dc61fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,12 +14,17 @@ jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set Version
run: |
printf -v CURDATE '%(%Y%m%d%H%M)' -1
echo "IMGVERSION=$CURDATE" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -42,4 +47,17 @@ jobs:
file: docker/base.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/ietf-tools/datatracker-app-base:latest
tags: |
ghcr.io/ietf-tools/datatracker-app-base:${{ env.IMGVERSION }}
ghcr.io/ietf-tools/datatracker-app-base:latest
- name: Update version references
run: |
sed -i "1s/.*/FROM ghcr.io/ietf-tools/datatracker-app-base:${{ env.IMGVERSION }}/" dev/build/Dockerfile
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: 'ci: update base image target version to ${{ env.IMGVERSION }}'
file_pattern: dev/build/Dockerfile