Skip to content

Commit 1e6cae3

Browse files
build: added selfhost workflow
1 parent ebe0e22 commit 1e6cae3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Self-host Docker Image
2+
on:
3+
push:
4+
branches: [ main ]
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
DOCKER_IMAGE_VERSION: ${{ vars.SELF_HOST_DOCKER_IMAGE_VERSION }}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
environment: self-host
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Log in to Docker Hub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
33+
34+
- name: Build and push (multi-arch)
35+
run: |
36+
docker buildx build \
37+
--platform linux/amd64,linux/arm64 \
38+
--build-arg GITHUB_TOKEN=${{ secrets.SPARROW_GITHUB_TOKEN }} \
39+
-t ssparrowapi/sparrow-proxy:self-host-${DOCKER_IMAGE_VERSION} \
40+
-t ssparrowapi/sparrow-proxy:latest \
41+
--push .

0 commit comments

Comments
 (0)