Repository navigation
76 lines (69 loc) · 2.18 KB
/
Copy pathdocker-publish.yml
File metadata and controls
76 lines (69 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Docker publish
on:
workflow_call:
inputs:
version:
type: string
required: true
dh-repository-owner:
type: string
required: true
push-latest:
type: string
required: true
jobs:
publish:
name: Tag and publish ${{ matrix.target }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- target: lightningd
tag_suffix: ''
- target: lightningd-vls-signer
tag_suffix: '-vls'
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Download platform digests for this target
uses: actions/download-artifact@v8
with:
pattern: digest_${{ matrix.target }}_*
path: /tmp/digests
merge-multiple: false
- name: Set up values
env:
DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }}
PUSH_LATEST: ${{ inputs.push-latest }}
VERSION: ${{ inputs.version }}
REF_TYPE: ${{ github.ref_type }}
run: |
DIGEST_REFS=""
for f in /tmp/digests/*/digest.txt; do
D=$(cat "$f")
DIGEST_REFS="$DIGEST_REFS ${DH_REPOSITORY_OWNER}/lightningd@${D}"
done
echo "DIGEST_REFS=$DIGEST_REFS" >> $GITHUB_ENV
if [[ "$PUSH_LATEST" == "true" ]] ||
([[ "$REF_TYPE" == "tag" ]] && [[ ! "$VERSION" =~ rc ]]); then
echo "PUSHLATEST=true" >> $GITHUB_ENV
else
echo "PUSHLATEST=false" >> $GITHUB_ENV
fi
- name: Create and push real tag(s)
env:
DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }}
VERSION: ${{ inputs.version }}
TAG_SUFFIX: ${{ matrix.tag_suffix }}
run: |
TAG_ARGS=(-t "${DH_REPOSITORY_OWNER}/lightningd:${VERSION}${TAG_SUFFIX}")
if [[ "$PUSHLATEST" == "true" ]]; then
TAG_ARGS+=(-t "${DH_REPOSITORY_OWNER}/lightningd:latest${TAG_SUFFIX}")
fi
docker buildx imagetools create "${TAG_ARGS[@]}" $DIGEST_REFS