Skip to content

Commit

Permalink
Merge pull request #2 from sujoshua/master
Browse files Browse the repository at this point in the history
ci支持pr编译测试
  • Loading branch information
sujoshua authored Aug 23, 2024
2 parents 7ba62db + de73b8a commit fd004a3
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- 'README.md'
- 'config/**'
- 'docs/**'
pull_request:
paths-ignore:
- 'README.md'
- 'config/**'
- 'docs/**'

jobs:
build:
Expand Down Expand Up @@ -83,4 +78,4 @@ jobs:
push: true
tags: |
ghcr.io/cquptmirror/worker:${{ matrix.worker }}
cquptmirror/worker:${{ matrix.worker }}
cquptmirror/worker:${{ matrix.worker }}
73 changes: 73 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and Push Docker Images

on:
pull_request:
paths-ignore:
- 'README.md'
- 'config/**'
- 'docs/**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ controller, manager, worker ]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/cquptmirror/${{ matrix.target }}
- name: Build and Push ${{ matrix.target }} image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile.${{ matrix.target }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-worker:
runs-on: ubuntu-latest
strategy:
matrix:
worker: [ anaconda, bandersnatch, entware, git, github-release ]
needs: build
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/cquptmirror/worker-${{ matrix.target }}
- name: Build and Push ${{ matrix.worker }} worker image
uses: docker/build-push-action@v5
with:
context: docker/worker/${{ matrix.worker }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit fd004a3

Please sign in to comment.