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
# Configures this workflow to run every time a change is pushed to the branch called `release`.
4
+
on:
5
+
push:
6
+
branches: ['main']
7
+
8
+
# 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.
9
+
env:
10
+
REGISTRY: ghcr.io
11
+
IMAGE_NAME: ${{ github.repository }}
12
+
13
+
jobs:
14
+
build-and-push-image:
15
+
runs-on: ubuntu-latest
16
+
steps:
17
+
- name: Checkout repository
18
+
uses: actions/checkout@v4
19
+
20
+
- name: Log in to the Container registry
21
+
uses: docker/login-action@v3
22
+
with:
23
+
registry: ${{ env.REGISTRY }}
24
+
username: ${{ github.actor }}
25
+
password: ${{ secrets.GITHUB_TOKEN }}
26
+
27
+
- name: Extract metadata (tags, labels) for Docker
28
+
id: meta
29
+
uses: docker/metadata-action@v5
30
+
with:
31
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32
+
33
+
- name: Set up QEMU
34
+
uses: docker/setup-qemu-action@v3
35
+
36
+
- name: Set up Docker Buildx
37
+
uses: docker/setup-buildx-action@v3
38
+
39
+
- name: Build and push Docker image
40
+
uses: docker/build-push-action@v5
41
+
with:
42
+
context: ./docker
43
+
push: true
44
+
tags: ${{ steps.meta.outputs.tags }}
45
+
labels: ${{ steps.meta.outputs.labels }}
46
+
platforms: linux/amd64,linux/arm64
47
+
48
+
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
0 commit comments