Skip to content

Commit c35721f

Browse files
committed
feat: add dev cicd
1 parent 7cf2bb4 commit c35721f

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

.github/workflows/build-dev.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build Dev
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-alpine:
17+
runs-on: self-hosted
18+
container:
19+
image: alpine:latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Install dependencies
23+
run: |
24+
apk update
25+
apk add --no-cache \
26+
bash \
27+
curl \
28+
git \
29+
go~=1.23 \
30+
gcc \
31+
musl-dev \
32+
nodejs \
33+
docker
34+
curl -fsSL https://bun.sh/install | bash
35+
mv /root/.bun/bin/bun /usr/local/bin/bun
36+
37+
- name: Verify installations
38+
run: |
39+
echo "=== Go Version ==="
40+
go version
41+
echo "\n=== Go Env ==="
42+
go env
43+
echo "\n=== Bun Version ==="
44+
bun --version
45+
46+
- name: build-frontend
47+
run: |
48+
git clone https://github.com/socoldkiller/headscale-ui.git
49+
cd headscale-ui
50+
git checkout dev
51+
bun install
52+
bun run build
53+
54+
- name: Build
55+
run: |
56+
cp -r headscale-ui/build hscontrol
57+
go build -ldflags="-s -w" -o headscale ./cmd/headscale
58+
59+
- name: Build Docker image
60+
run: |
61+
echo "FROM alpine:latest" > Dockerfile
62+
echo "COPY headscale /usr/local/bin/headscale" >> Dockerfile
63+
echo "ENTRYPOINT [\"headscale\", \"serve\"]" >> Dockerfile
64+
docker build -t ghcr.io/${{ github.repository }}:dev .

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414

1515
jobs:
1616
build-nix:
17-
runs-on: ubuntu-latest
17+
runs-on: self-hosted
1818
permissions: write-all
1919
steps:
2020
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)