Skip to content

Commit 4cc4140

Browse files
committed
Add Github Action workflow
1 parent 70de177 commit 4cc4140

File tree

2 files changed

+86
-80
lines changed

2 files changed

+86
-80
lines changed

.github/workflows/codeql.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.github/workflows/docker-build.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Docker Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/btcpayserver
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
images: ${{ env.REGISTRY_IMAGE }}
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v1
26+
- name: Login to GitHub Container Registry
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Build and push
33+
id: build
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
platforms: linux/amd64,linux/arm64
38+
labels: ${{ steps.meta.outputs.labels }}
39+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
40+
build-args: |
41+
GIT_COMMIT=${{ github.sha }}
42+
CONFIGURATION_NAME=Altcoins-Release
43+
- name: Export digest
44+
run: |
45+
mkdir -p /tmp/digests
46+
digest="${{ steps.build.outputs.digest }}"
47+
touch "/tmp/digests/${digest#sha256:}"
48+
- name: Upload digest
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: digests
52+
path: /tmp/digests/*
53+
if-no-files-found: error
54+
retention-days: 1
55+
56+
merge:
57+
runs-on: ubuntu-latest
58+
needs:
59+
- build
60+
steps:
61+
- name: Download digests
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: digests
65+
path: /tmp/digests
66+
- name: Set up Docker Buildx
67+
uses: docker/setup-buildx-action@v3
68+
- name: Docker meta
69+
id: meta
70+
uses: docker/metadata-action@v5
71+
with:
72+
images: ${{ env.REGISTRY_IMAGE }}
73+
- name: Login to GitHub Container Registry
74+
uses: docker/login-action@v3
75+
with:
76+
registry: ghcr.io
77+
username: ${{ github.repository_owner }}
78+
password: ${{ secrets.GITHUB_TOKEN }}
79+
- name: Create manifest list and push
80+
working-directory: /tmp/digests
81+
run: |
82+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
83+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
84+
- name: Inspect image
85+
run: |
86+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)