Skip to content

Commit dd01b90

Browse files
committed
github: initial docker workflow
Builds a Docker image for tags starting with 'v' The image repository name is defined by environment variable DOCKER_REPO, which defaults to: lightninglabs/loop To override it, if you want to publish the image to your own DockerHub account, define a Github Actions secret named DOCKER_REPO with the full image repo name such as: <docker_user>/loop
1 parent 6deed23 commit dd01b90

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/docker.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker image build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
main:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Set up QEMU
17+
uses: lightninglabs/gh-actions/[email protected]
18+
19+
- name: Set up Docker buildx
20+
uses: lightninglabs/gh-actions/[email protected]
21+
22+
- name: Login to DockerHub
23+
uses: lightninglabs/gh-actions/[email protected]
24+
with:
25+
username: ${{ secrets.DOCKER_USERNAME }}
26+
password: ${{ secrets.DOCKER_API_KEY }}
27+
28+
- name: Set env
29+
run: |
30+
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
31+
DOCKER_REPO_DEFAULT=${{secrets.DOCKER_REPO}}
32+
echo "DOCKER_REPO=${DOCKER_REPO_DEFAULT:-lightninglabs/loop}" >> $GITHUB_ENV
33+
34+
- name: Build and push image
35+
id: docker_build
36+
uses: lightninglabs/gh-actions/[email protected]
37+
with:
38+
push: true
39+
platforms: linux/amd64,linux/arm64
40+
tags: "${{ env.DOCKER_REPO }}:${{ env.RELEASE_VERSION }}"
41+
build-args: checkout=${{ env.RELEASE_VERSION }}
42+
43+
- name: Image digest
44+
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)