Skip to content

Commit eb45173

Browse files
committed
add docker build action
1 parent aaac2af commit eb45173

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Publish Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_and_push:
10+
runs-on: ubuntu-latest
11+
env:
12+
IMAGE_NAME: headscale
13+
GHCR: ghcr.io
14+
GHCR_IMAGE_NAME: ${{ github.repository }}
15+
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Login to Docker Hub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Login to GitHub Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.GHCR }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Build and push
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
push: true
41+
tags: |
42+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
43+
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:latest
44+
file: ./Dockerfile

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ services:
33
web:
44
build: .
55
ports:
6-
- "8888:8888"
6+
- "8888:8888"
7+
command: ["python", "run.py", "--fbidhttp=False"]

0 commit comments

Comments
 (0)