Skip to content

Commit 886d148

Browse files
committed
GitHub: add workflow for building tagged docker images
We add a GitHub workflow that is triggered whenever a new version tag is pushed. It will trigger a docker image build for that version and automatically push it to the specified repo.
1 parent 64d53f7 commit 886d148

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/docker.yml

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

0 commit comments

Comments
 (0)