Skip to content

Commit ca2cf4f

Browse files
committed
add Docker job
1 parent c2ebeab commit ca2cf4f

File tree

3 files changed

+71
-4
lines changed

3 files changed

+71
-4
lines changed

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
workflow_dispatch:
44
pull_request:
55
branches: [main]
6-
push:
7-
branches: [main]
6+
# push:
7+
# branches: [main]
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/docker.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Docker image
2+
on:
3+
push:
4+
branches: [main]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions:
10+
actions: write # Necessary to cancel workflow executions
11+
checks: write # Necessary to write reports
12+
pull-requests: write # Necessary to comment on PRs
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Read version
24+
run: echo VERSION=$(cat package.json | jq -r '.version') >> $GITHUB_ENV
25+
26+
- name: Docker meta
27+
id: meta
28+
uses: docker/metadata-action@v5
29+
with:
30+
images: |
31+
ghcr.io/inato/custom-instrumentations-node/custom-instrumentations-nodejs
32+
tags: |
33+
type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }}
34+
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Cache Docker layers
42+
uses: actions/cache@v4
43+
with:
44+
path: /tmp/.buildx-cache
45+
key: ${{ runner.os }}-buildx-${{ github.sha }}
46+
restore-keys: |
47+
${{ runner.os }}-buildx-
48+
49+
- name: Login to GitHub Package Registry
50+
uses: docker/login-action@v3
51+
with:
52+
registry: ghcr.io
53+
username: ${{ github.repository_owner }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Build and push
57+
uses: docker/build-push-action@v6
58+
with:
59+
context: .
60+
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
61+
push: true
62+
build-args: version=${{ env.VERSION }}
63+
tags: ${{ steps.meta.outputs.tags }}
64+
labels: ${{ steps.meta.outputs.labels }}
65+
cache-from: type=local,src=/tmp/.buildx-cache
66+
cache-to: type=local,dest=/tmp/.buildx-cache

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Release
22
on:
3-
push:
4-
branches: [main]
3+
{}
4+
# push:
5+
# branches: [main]
56

67
concurrency:
78
group: ${{ github.workflow }}-${{ github.ref }}

0 commit comments

Comments
 (0)