You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update builder_release.yml to use Docker Buildx for multi-platform image building (#45)
This pull request updates the builder_release.yml file to use Docker Buildx for multi-platform image building. The changes include setting up Docker Buildx, logging in to the Container registry, extracting metadata for Docker, and building and pushing the Docker image. The update also adds support for building images for both Linux AMD64 and Linux ARM64 platforms.
Copy file name to clipboardExpand all lines: .github/workflows/builder_release.yml
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,13 @@ name: Publish to GHCR
3
3
4
4
# Configures this workflow to run every time a change is pushed to the branch called `release`.
5
5
on:
6
-
push:
7
-
branches: ['release']
6
+
release:
7
+
types: [published]
8
8
workflow_dispatch:
9
9
10
10
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
11
11
env:
12
12
REGISTRY: ghcr.io
13
-
IMAGE_NAME: ${{ github.repository }}_noha
14
13
15
14
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
16
15
jobs:
@@ -24,26 +23,30 @@ jobs:
24
23
steps:
25
24
- name: Checkout repository
26
25
uses: actions/checkout@v4
26
+
# This step sets up the Docker Buildx builder. This allows the workflow to build and push multi-platform images.
27
+
- name: Set up Docker Buildx
28
+
uses: docker/setup-buildx-action@v3
27
29
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
28
30
- name: Log in to the Container registry
29
-
uses: docker/login-action@v3.1
31
+
uses: docker/login-action@v3
30
32
with:
31
33
registry: ${{ env.REGISTRY }}
32
-
username: ${{ github.actor }}
34
+
username: ${{ github.repository_owner }}
33
35
password: ${{ secrets.GITHUB_TOKEN }}
34
36
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
35
37
- name: Extract metadata (tags, labels) for Docker
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
41
43
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
42
44
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
0 commit comments