Skip to content

Commit 3238bec

Browse files
authored
Merge pull request #3 from mbroton/ci-gh-actions
Add CI and Release workflows for Docker builds and GitHub releases
2 parents ee94862 + 9df8f8d commit 3238bec

File tree

3 files changed

+128
-10
lines changed

3 files changed

+128
-10
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
packages: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
docker-build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: docker/setup-buildx-action@v3
21+
22+
- name: Build proxy (no push)
23+
uses: docker/build-push-action@v6
24+
with:
25+
context: ./proxy
26+
file: ./proxy/Dockerfile
27+
push: false
28+
platforms: linux/amd64
29+
30+
- name: Build worker (no push)
31+
uses: docker/build-push-action@v6
32+
with:
33+
context: ./worker
34+
file: ./worker/Dockerfile
35+
push: false
36+
platforms: linux/amd64

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
permissions:
8+
contents: write
9+
packages: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
REGISTRY: ghcr.io
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: docker/setup-qemu-action@v3
24+
- uses: docker/setup-buildx-action@v3
25+
26+
- name: Log in to GHCR
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Docker meta (proxy)
34+
id: meta-proxy
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: ghcr.io/${{ github.repository }}/proxy
38+
tags: |
39+
type=semver,pattern={{version}}
40+
type=semver,pattern={{major}}.{{minor}}
41+
type=semver,pattern={{major}}
42+
type=raw,value=latest
43+
44+
- name: Build and push (proxy)
45+
uses: docker/build-push-action@v6
46+
with:
47+
context: ./proxy
48+
file: ./proxy/Dockerfile
49+
push: true
50+
platforms: linux/amd64,linux/arm64
51+
tags: ${{ steps.meta-proxy.outputs.tags }}
52+
labels: ${{ steps.meta-proxy.outputs.labels }}
53+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/proxy:buildcache
54+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/proxy:buildcache,mode=max
55+
56+
- name: Docker meta (worker)
57+
id: meta-worker
58+
uses: docker/metadata-action@v5
59+
with:
60+
images: ghcr.io/${{ github.repository }}/worker
61+
tags: |
62+
type=semver,pattern={{version}}
63+
type=semver,pattern={{major}}.{{minor}}
64+
type=semver,pattern={{major}}
65+
type=raw,value=latest
66+
67+
- name: Build and push (worker)
68+
uses: docker/build-push-action@v6
69+
with:
70+
context: ./worker
71+
file: ./worker/Dockerfile
72+
push: true
73+
platforms: linux/amd64,linux/arm64
74+
tags: ${{ steps.meta-worker.outputs.tags }}
75+
labels: ${{ steps.meta-worker.outputs.labels }}
76+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/worker:buildcache
77+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/worker:buildcache,mode=max
78+
79+
- name: Create GitHub Release
80+
uses: softprops/action-gh-release@v2
81+
with:
82+
generate_release_notes: true

worker/package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)