fix: fix dev CI #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Dev | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-alpine: | |
runs-on: self-hosted | |
container: | |
image: alpine:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
apk update | |
apk add --no-cache \ | |
bash \ | |
curl \ | |
git \ | |
go~=1.23 \ | |
gcc \ | |
musl-dev \ | |
nodejs \ | |
docker | |
curl -fsSL https://bun.sh/install | bash | |
mv ~/.bun/bin/bun /usr/local/bin/bun | |
- name: Verify installations | |
run: | | |
echo "=== Go Version ===" | |
go version | |
echo "\n=== Go Env ===" | |
go env | |
echo "\n=== Bun Version ===" | |
bun --version | |
- name: build-frontend | |
run: | | |
git clone https://github.com/socoldkiller/headscale-ui.git | |
cd headscale-ui | |
git checkout dev | |
bun install | |
bun run build | |
- name: Build | |
run: | | |
cp -r headscale-ui/build hscontrol | |
go build -ldflags="-s -w" -o headscale ./cmd/headscale | |
- name: Build Docker image | |
run: | | |
echo "FROM alpine:latest" > Dockerfile | |
echo "COPY headscale /usr/local/bin/headscale" >> Dockerfile | |
echo "ENTRYPOINT [\"headscale\", \"serve\"]" >> Dockerfile | |
docker build -t ghcr.io/${{ github.repository }}:dev . |