Skip to content

Commit 1dd481d

Browse files
committed
fix: feat add docker images
1 parent 8c75083 commit 1dd481d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/build-dev.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- dev
7+
- CI
78
pull_request:
89
branches:
910
- main
@@ -19,7 +20,7 @@ jobs:
1920
image: ghcr.io/socoldkiller/headscale-build:dev
2021
credentials:
2122
username: ${{ github.actor }}
22-
password: ${{secrets.TOKEN }}
23+
password: ${{secrets.GITHUB_TOKEN}}
2324
steps:
2425
- uses: actions/checkout@v4
2526

@@ -36,15 +37,18 @@ jobs:
3637
- name: Build binary
3738
run: |
3839
go build -ldflags="-s -w" -o headscale ./cmd/headscale
40+
41+
- name: Login to GHCR
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.repository_owner }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
3947

4048
- name: build docker image
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.TOKEN }}
4349
run: |
4450
echo "FROM alpine:latest" > Dockerfile
4551
echo "COPY headscale /usr/local/bin/headscale" >> Dockerfile
46-
echo "ENTRYPOINT [\"headscale\", \"serve\"]" >> Dockerfile
47-
52+
echo "ENTRYPOINT [\"headscale\", \"serve\"]" >> Dockerfile
4853
docker build -t ghcr.io/${{ github.repository }}:dev .
49-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
5054
docker push ghcr.io/${{ github.repository }}:dev

0 commit comments

Comments
 (0)