Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize Docker CI #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Build Docker container on push

on:
push:
branches:
- "*"
push:
branches:
- "*"

jobs:
build:
name: Build image
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout project
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set env variables
run: |
Expand All @@ -21,23 +26,23 @@ jobs:
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
id: qemu

- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
id: buildx

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
--output "type=registry" ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
--output "type=registry" ./
18 changes: 9 additions & 9 deletions .github/workflows/docker-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:
jobs:
build:
name: Build image
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout project
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set env variables
run: |
Expand All @@ -22,21 +22,21 @@ jobs:
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$TAG \
--output "type=registry" ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$TAG \
--output "type=registry" ./
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim-bullseye
FROM python:3.12-slim-bookworm

RUN pip install --upgrade pip

Expand Down