Create docker-build.yml

pull/4914/head
chiwanwong1212-afk 2025-08-07 17:04:53 +08:00 committed by GitHub
parent af6bc6369d
commit e781071b02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 31 additions and 0 deletions

31
.github/workflows/docker-build.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Build and Push Docker Image to GHCR
on:
push:
tags:
- 'v*' # 推送任何以 v 开头的标签时触发,如 v0.63.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/frp:${{ github.ref_name }}