···
12
-
SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
17
-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
18
-
runs-on: ubuntu-latest
21
-
image: catthehacker/ubuntu:act-latest
24
-
uses: actions/checkout@v3
29
-
echo REGISTRY_DOMAIN=$(echo ${GITHUB_SERVER_URL} | sed 's\^https://\\') >> $GITHUB_OUTPUT
32
-
uses: https://github.com/docker/setup-qemu-action@v2
34
-
- name: Set up Docker BuildX
35
-
uses: https://github.com/docker/setup-buildx-action@v2
37
-
- name: Login to registry
38
-
uses: https://github.com/docker/login-action@v2
40
-
registry: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}
41
-
username: ${{ github.repository_owner }}
42
-
password: ${{ secrets.CI_REGISTRY_TOKEN }}
44
-
- name: Docker metadata
46
-
uses: https://github.com/docker/metadata-action@v4
48
-
images: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}/${{ github.repository }}
50
-
org.opencontainers.image.revision=${{ env.SHA }}
52
-
type=edge,branch=$repo.default_branch
53
-
type=sha,prefix=,suffix=,format=short
54
-
type=raw,value=latest,enable={{is_default_branch}}
56
-
- name: Build and push
57
-
uses: https://github.com/docker/build-push-action@v4
59
-
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
66
-
push: ${{ github.event_name != 'pull_request' }}
67
-
tags: ${{ steps.meta.outputs.tags }}
68
-
labels: ${{ steps.meta.outputs.labels }}
69
-
cache-from: type=gha
70
-
cache-to: type=gha,mode=max
72
-
# - name: Docker Scout
74
-
# if: ${{ github.event_name == 'pull_request' }}
75
-
# uses: https://github.com/docker/scout-action@v0.23.4
77
-
# dockerhub-user: ${{ secrets.DOCKERHUB_USER }}
78
-
# dockerhub-password: ${{ secrets.DOCKERHUB_PASSWORD }}
80
-
# # image: ${{ steps.meta.outputs.tags }}
81
-
# to: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.COMPARE_TAG }}
82
-
# ignore-unchanged: true
83
-
# write-comment: true
84
-
# github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment
12
+
SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
17
+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
18
+
runs-on: ubuntu-latest
21
+
image: catthehacker/ubuntu:act-latest
24
+
uses: actions/checkout@v4
29
+
echo REGISTRY_DOMAIN=$(echo ${GITHUB_SERVER_URL} | sed 's\^https://\\') >> $GITHUB_OUTPUT
32
+
uses: docker/setup-qemu-action@v2
34
+
- name: Set up Docker BuildX
35
+
uses: docker/setup-buildx-action@v2
37
+
- name: Login to registry
38
+
uses: docker/login-action@v2
40
+
registry: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}
41
+
username: ${{ github.repository_owner }}
42
+
password: ${{ secrets.CI_REGISTRY_TOKEN }}
44
+
- name: Docker metadata
46
+
uses: docker/metadata-action@v4
48
+
images: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}/${{ github.repository }}
50
+
org.opencontainers.image.revision=${{ env.SHA }}
52
+
type=edge,branch=$repo.default_branch
53
+
type=sha,prefix=,suffix=,format=short
54
+
type=raw,value=latest,enable={{is_default_branch}}
56
+
- name: Build and push
57
+
uses: docker/build-push-action@v4
59
+
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
66
+
push: ${{ github.event_name != 'pull_request' }}
67
+
tags: ${{ steps.meta.outputs.tags }}
68
+
labels: ${{ steps.meta.outputs.labels }}
69
+
cache-from: type=gha
70
+
cache-to: type=gha,mode=max
72
+
# - name: Docker Scout
74
+
# if: ${{ github.event_name == 'pull_request' }}
75
+
# uses: docker/scout-action@v0.23.4
77
+
# dockerhub-user: ${{ secrets.DOCKERHUB_USER }}
78
+
# dockerhub-password: ${{ secrets.DOCKERHUB_PASSWORD }}
80
+
# # image: ${{ steps.meta.outputs.tags }}
81
+
# to: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.COMPARE_TAG }}
82
+
# ignore-unchanged: true
83
+
# write-comment: true
84
+
# github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment