forked from imiphp/imi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: daily-image-build | ||
|
||
on: | ||
schedule: | ||
- cron: "0 16 * * *" # 这个值是 UTC 时间,每天北京时间 0 点执行 | ||
push: | ||
paths: | ||
- ".github/workflows/daily-image-build.yml" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/daily-image-build.yml" | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build-image: | ||
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 | ||
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 to Docker | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
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 }} |