Skip to content

ci支持pr编译测试 #1

ci支持pr编译测试

ci支持pr编译测试 #1

Workflow file for this run

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 }}