feat: update IP #34
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 | |
- CI | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/socoldkiller/headscale-build:dev | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Build frontend | |
run: | | |
git clone https://github.com/socoldkiller/headscale-ui.git /ui | |
cd /ui | |
git checkout dev | |
bun install | |
bun run build | |
- uses: actions/checkout@v4 | |
- name: Build binary | |
run: | | |
git config --global --add safe.directory $PWD | |
cp -r /ui/build hscontrol | |
go build -ldflags="-s -w" -o headscale ./cmd/headscale | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- 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 . | |
docker push ghcr.io/${{ github.repository }}:dev |