15
15
- name : Prepare Docker tag
16
16
id : prep
17
17
run : |
18
- DOCKER_IMAGE=ledgerhq/bitcoin-lib-grpc
19
-
20
18
VERSION=noop
21
19
if [[ $GITHUB_REF == refs/tags/* ]]; then
22
20
VERSION=${GITHUB_REF#refs/tags/}
@@ -26,46 +24,17 @@ jobs:
26
24
VERSION=latest
27
25
fi
28
26
fi
27
+ echo ::set-output name=tags::${VERSION}
29
28
30
- TAGS="${DOCKER_IMAGE}:${VERSION}"
31
-
32
- echo ::set-output name=version::${VERSION}
33
- echo ::set-output name=tags::${TAGS}
34
- echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
35
-
36
- - name : Set up Docker Buildx
37
- uses : docker/setup-buildx-action@v1
38
-
39
- - name : Cache Docker layers
40
- uses : actions/cache@v2
41
- with :
42
- path : /tmp/.buildx-cache
43
- key : ${{ runner.os }}-buildx-${{ github.sha }}
44
- restore-keys : |
45
- ${{ runner.os }}-buildx-
46
-
47
- - name : Check out the repo
29
+ - name : Clone
48
30
uses : actions/checkout@v2
49
31
50
- - name : Login to DockerHub
51
- uses : docker/login-action@v1
52
- with :
53
- username : ${{ secrets.DOCKERHUB_USERNAME }}
54
- password : ${{ secrets.DOCKERHUB_TOKEN }}
55
-
56
- - name : Build and push to Docker Hub
57
- id : docker_hub
58
- uses : docker/build-push-action@v2
32
+ - name : Build and publish to GitHub Packages
33
+ uses : docker/build-push-action@v1
59
34
with :
60
- pull : true
61
- push : true
35
+ repository : ledgerhq/bitcoin-lib-grpc/bitcoin-lib-grpc
36
+ registry : docker.pkg.github.com
37
+ username : ${{ github.actor }}
38
+ password : ${{ secrets.GITHUB_TOKEN }}
62
39
tags : ${{ steps.prep.outputs.tags }}
63
- labels : |
64
- org.opencontainers.image.title=${{ github.event.repository.name }}
65
- org.opencontainers.image.description=${{ github.event.repository.description }}
66
- org.opencontainers.image.url=${{ github.event.repository.html_url }}
67
- org.opencontainers.image.source=${{ github.event.repository.clone_url }}
68
- org.opencontainers.image.version=${{ steps.prep.outputs.version }}
69
- org.opencontainers.image.created=${{ steps.prep.outputs.created }}
70
- org.opencontainers.image.revision=${{ github.sha }}
71
- org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
40
+ push : true
0 commit comments