Skip to content

Commit

Permalink
[3.0] 添加测试用镜像构建 (#630)
Browse files Browse the repository at this point in the history
* Add: daily-image-build.yml

* Update: 改进

* Update: daily-image-build.yml
  • Loading branch information
NHZEX authored Nov 7, 2023
1 parent f14872f commit bf1e5bf
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/daily-image-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Daily Images Build

on:
schedule:
- cron: "0 16 * * *" # 这个值是 UTC 时间,每天北京时间 0 点执行
push:
paths:
- ".github/workflows/daily-image-build.yml"
- ".github/swoole.dockerfile"
- ".github/php.dockerfile"
pull_request:
paths:
- ".github/workflows/daily-image-build.yml"
- ".github/swoole.dockerfile"
- ".github/php.dockerfile"

permissions:
contents: read
packages: write

jobs:
build-swoole:
name: Linux Build-Image-${{ matrix.image.tag }}
runs-on: ubuntu-latest
strategy:
matrix:
image:
- {tag: php8.2-swoole-5.1, version: 5.1-php8.2}
- {tag: php8.1-swoole-5.1, version: 5.1-php8.1}
- {tag: php8.2-swoole-5.0, version: 5.0-php8.2}
- {tag: php8.1-swoole-5.0, version: 5.0-php8.1}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/imi-swoole-test
tags: |
type=raw,${{ matrix.image.tag }}
- name: Log in to Github
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image
uses: docker/build-push-action@v5
with:
context: ./.github
file: ./.github/swoole.dockerfile
build-args: |
SWOOLE_DOCKER_VERSION=${{ matrix.image.version }}
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit bf1e5bf

Please sign in to comment.