Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit d80f243

Browse files
committed
Publish image to gh packages
1 parent b3987b6 commit d80f243

File tree

1 file changed

+9
-40
lines changed

1 file changed

+9
-40
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
- name: Prepare Docker tag
1616
id: prep
1717
run: |
18-
DOCKER_IMAGE=ledgerhq/bitcoin-lib-grpc
19-
2018
VERSION=noop
2119
if [[ $GITHUB_REF == refs/tags/* ]]; then
2220
VERSION=${GITHUB_REF#refs/tags/}
@@ -26,46 +24,17 @@ jobs:
2624
VERSION=latest
2725
fi
2826
fi
27+
echo ::set-output name=tags::${VERSION}
2928
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
4830
uses: actions/checkout@v2
4931

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
5934
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 }}
6239
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

Comments
 (0)