Skip to content

Commit b473591

Browse files
authored
Create pr-docker.yaml
1 parent 377a766 commit b473591

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/pr-docker.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build Docker Image on PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master # or your default branch
7+
8+
env:
9+
GH_TOKEN: ${{secrets.GH_TOKEN}}
10+
11+
jobs:
12+
push:
13+
name: "Build Docker Image"
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Qemu
21+
uses: docker/setup-qemu-action@v3
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
with:
26+
buildkitd-flags: --debug
27+
28+
- uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.repository_owner }}
32+
password: ${{ secrets.GH_TOKEN }}
33+
34+
- uses: docker/build-push-action@v5
35+
with:
36+
context: ./
37+
file: ./LinkRouter/Dockerfile
38+
platforms: linux/amd64,linux/arm64
39+
push: true
40+
tags: |
41+
ghcr.io/${{ github.repository_owner }}/linkrouter:pr-${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)