Skip to content

Commit

Permalink
Add: daily-image-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX committed Nov 6, 2023
1 parent f14872f commit 6f46772
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/daily-image-build.yml
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 }}

0 comments on commit 6f46772

Please sign in to comment.