···
16
+
IMAGE_NAME: ${{ github.repository }}
20
+
runs-on: self-hosted
27
+
- name: Checkout repository
28
+
uses: actions/checkout@v3
30
+
- name: Install cosign
31
+
if: github.event_name != 'pull_request'
32
+
uses: sigstore/cosign-installer@v3.7.0
34
+
cosign-release: "v2.4.1"
36
+
- name: Setup Docker buildx
37
+
uses: docker/setup-buildx-action@v3
39
+
- name: Log into registry ${{ env.REGISTRY }}
40
+
if: github.event_name != 'pull_request'
41
+
uses: docker/login-action@v3
43
+
registry: ${{ env.REGISTRY }}
44
+
username: ${{ github.actor }}
45
+
password: ${{ secrets.GITHUB_TOKEN }}
47
+
- name: Log in to Docker Hub
48
+
if: github.event_name != 'pull_request'
49
+
uses: docker/login-action@v3
51
+
username: ${{ secrets.DOCKER_USERNAME }}
52
+
password: ${{ secrets.DOCKER_PASSWORD }}
54
+
- name: Extract metadata (tags, labels) for Docker
56
+
uses: docker/metadata-action@v5
59
+
${{ env.IMAGE_NAME }}
60
+
${{ env.REGISTRY }}/${{ github.repository }}
62
+
- name: Build and push Docker image (amd64)
63
+
uses: docker/build-push-action@v6
67
+
platforms: linux/amd64
68
+
push: ${{ github.event_name != 'pull_request' }}
69
+
tags: ${{ steps.meta.outputs.tags }}-amd64
70
+
labels: ${{ steps.meta.outputs.labels }}
72
+
- name: Build and push Docker image (arm64)
73
+
uses: docker/build-push-action@v6
77
+
platforms: linux/arm64
78
+
push: ${{ github.event_name != 'pull_request' }}
79
+
tags: ${{ steps.meta.outputs.tags }}-arm64
80
+
labels: ${{ steps.meta.outputs.labels }}