Skip to content

Commit c922666

Browse files
authored
Add GitHub Actions workflow for Docker image deployment
Signed-off-by: G1org1o <77230371+G1org1owo@users.noreply.github.com>
1 parent ea79b55 commit c922666

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy custom tailscale image to GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.REPO_KEY }}
21+
ref: main
22+
23+
- name: Login to GHCR
24+
uses: docker/login-action@v2
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.REPO_KEY }}
29+
30+
- name: Build and push Docker image
31+
run: |
32+
OWNER_NAME=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
33+
docker build . -t ghcr.io/$OWNER_NAME/tailscale:latest
34+
docker push ghcr.io/$OWNER_NAME/tailscale:latest

0 commit comments

Comments
 (0)