···
12
+
SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
···
image: catthehacker/ubuntu:act-latest
uses: actions/checkout@v3
echo REGISTRY_DOMAIN=$(echo ${GITHUB_SERVER_URL} | sed 's\^https://\\') >> $GITHUB_OUTPUT
25
-
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
28
-
uses: docker/setup-qemu-action@v2
32
+
uses: https://github.com/docker/setup-qemu-action@v2
- name: Set up Docker BuildX
31
-
uses: docker/setup-buildx-action@v2
35
+
uses: https://github.com/docker/setup-buildx-action@v2
- name: Login to registry
34
-
uses: docker/login-action@v2
38
+
uses: https://github.com/docker/login-action@v2
36
-
registry: ${{ steps.meta.outputs.REGISTRY_DOMAIN }}
40
+
registry: ${{ steps.repometa.outputs.REGISTRY_DOMAIN }}
username: ${{ github.repository_owner }}
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}}
41
-
uses: docker/build-push-action@v4
57
+
uses: https://github.com/docker/build-push-action@v4
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
···
52
-
${{ steps.meta.outputs.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ steps.meta.outputs.REPO_VERSION }}
53
-
${{ steps.meta.outputs.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.DOCKER_TAG }}
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