-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add base image, prepared for arm64 compilation
- Loading branch information
Showing
9 changed files
with
289 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Build and Push Ubuntu-rust-gtk4 | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "docker" | ||
schedule: | ||
- cron: "15 8 1 */1 *" | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: amd64 | ||
arch: amd64 | ||
- platform: arm64 | ||
arch: arm64v8 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- 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 Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Metadata | ||
run: | | ||
echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV} | ||
- name: Build and push for ${{ matrix.platform }} | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: docker | ||
platforms: linux/${{ matrix.platform }} | ||
push: true | ||
tags: | | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ matrix.platform }} | ||
build-args: | | ||
ARCH=${{ matrix.arch }} | ||
provenance: false | ||
|
||
merge: | ||
needs: build-and-push | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Login to Github Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Metadata | ||
id: date | ||
run: | | ||
echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV} | ||
echo "date=$(date --rfc-3339=date)" >> ${GITHUB_OUTPUT} | ||
- name: Create multi-arch manifest for latest tag | ||
run: | | ||
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 | ||
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 --arch amd64 | ||
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 --arch arm64 | ||
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest | ||
- name: Create multi-arch manifest for date tag | ||
run: | | ||
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 | ||
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 --arch amd64 | ||
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \ | ||
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 --arch arm64 | ||
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} | ||
- name: Check push | ||
run: | | ||
docker buildx imagetools inspect ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest |
File renamed without changes.
Oops, something went wrong.