Skip to content

Commit

Permalink
ci: merge main to release (#8262)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks authored Nov 22, 2024
2 parents 1a4df2d + ec02890 commit 7f65171
Show file tree
Hide file tree
Showing 6 changed files with 270 additions and 258 deletions.
132 changes: 66 additions & 66 deletions .github/workflows/build-base-app.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,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
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
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Add feature-latest tag
if: ${{ startsWith(github.ref_name, 'feat/') }}
run: echo "FEATURE_LATEST_TAG=$(echo $GITHUB_REF_NAME | tr / -)" >> $GITHUB_ENV

- name: Build Images
uses: docker/build-push-action@v6
env:
Expand All @@ -265,7 +269,9 @@ jobs:
file: dev/build/Dockerfile
platforms: ${{ github.event.inputs.skiparm == 'true' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
push: true
tags: ghcr.io/ietf-tools/datatracker:${{ env.PKG_VERSION }}
tags: |
ghcr.io/ietf-tools/datatracker:${{ env.PKG_VERSION }}
${{ env.FEATURE_LATEST_TAG && format('ghcr.io/ietf-tools/datatracker:{0}-latest', env.FEATURE_LATEST_TAG) || null }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
Loading

0 comments on commit 7f65171

Please sign in to comment.