-
Notifications
You must be signed in to change notification settings - Fork 378
66 lines (55 loc) · 1.78 KB
/
build-base-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build Base App Docker Image
on:
push:
branches:
- 'main'
paths:
- 'docker/base.Dockerfile'
- 'requirements.txt'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_COMMON_TOKEN }}
- name: Set Version
run: |
printf -v CURDATE '%(%Y%m%dT%H%M)T' -1
echo "IMGVERSION=$CURDATE" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build & Push
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
file: docker/base.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
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
echo "${{ env.IMGVERSION }}" > dev/build/TARGET_BASE
- 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 dev/build/TARGET_BASE