测试自动发布docker镜像
Some checks failed
Build Docker Image And Push / Build PHP ${{ matrix.php-version }} (ubuntu-latest, 8.0) (push) Failing after 4s

This commit is contained in:
meng 2024-03-14 14:45:26 +08:00
parent 99ceab32b0
commit 7d7aaee828
6 changed files with 20 additions and 62 deletions

View File

@ -1,8 +1,6 @@
name: Build Docker Image name: Build Docker Image And Push
on: on:
schedule:
- cron: '0 1 * * 0'
push: push:
tags: [ 'v*.*.*' ] tags: [ 'v*.*.*' ]
@ -19,15 +17,16 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ ubuntu-latest ] os: [ ubuntu-latest ]
php-version: [ '7.4', '8.0', '8.1', '8.2' ] php-version: ['8.0']
max-parallel: 8 max-parallel: 8
steps: steps:
- name: Login to Docker Hub - name: Login to Git Hub
# https://github.com/docker/login-action#docker-hub # https://github.com/docker/login-action#docker-hub
uses: docker/login-action@v2 uses: https://git.des8.com/docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} registry: git.des8.com
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_PASSWORD }}
- name: Build and push - name: Build and push
# https://github.com/docker/build-push-action # https://github.com/docker/build-push-action
@ -39,5 +38,5 @@ jobs:
COMPOSER_VERSION=${{ env.COMPOSER_VERSION }} COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}
push: true push: true
tags: | tags: |
${{ secrets.DOCKER_USERNAME }}/docker-webman:${{ env.PHP_CLI_VERSION }} ${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}
${{ secrets.DOCKER_USERNAME }}/docker-webman:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }} ${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }}

View File

@ -1,35 +0,0 @@
name: Keep Actions Running
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Get current time
uses: josStorer/get-current-time@v2
with:
format: "YYYY/MM/DD HH:mm:ss.SSS"
id: current-time
- name: Update Json File
uses: restackio/update-json-file-action@v2.0
with:
file: composer.json
fields: "{\"config.github-actions-date\": \"${{ steps.current-time.outputs.time }}\"}"
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: keep actions running
file_pattern: composer.json

View File

@ -1,5 +1,5 @@
# https://hub.docker.com/_/php # https://hub.docker.com/_/php
ARG PHP_CLI_VERSION=7.4-cli-alpine ARG PHP_CLI_VERSION=8.1-cli-alpine
# https://hub.docker.com/r/mlocati/php-extension-installer # https://hub.docker.com/r/mlocati/php-extension-installer
ARG PHP_EXTENSION_INSTALL_VERSION=latest ARG PHP_EXTENSION_INSTALL_VERSION=latest
# https://hub.docker.com/r/composer/composer # https://hub.docker.com/r/composer/composer

View File

@ -6,16 +6,10 @@
### 镜像地址和 tag ### 镜像地址和 tag
[docker hub](https://hub.docker.com/r/krisss/docker-webman) [docker hub](https://hub.docker.com/r/heibai2006/webman-docker)
- krisss/docker-webman:7.4-cli-alpine - https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
- krisss/docker-webman:8.0-cli-alpine
- krisss/docker-webman:8.1-cli-alpine
- krisss/docker-webman:8.2-cli-alpine
> 此镜像会通过 github actions 动态更新 php 的小版本,镜像 tag 名不变
> 2.3.0 之后增加类似 `7.4-cli-alpine-v2.3.0` 形式的镜像版本,用于固定一个在发布版本时当前镜像中的各个组件版本(求稳可以用这种版本的镜像)
### 镜像中的组件 ### 镜像中的组件
@ -27,7 +21,7 @@
## 安装 ## 安装
```bash ```bash
composer require webman-tech/docker composer require https://git.des8.com/heibai2006/webman-docker
``` ```
会在项目根目录下提供 `Dockerfile` 用于构建镜像,提供 `docker-compose.yml` 用于开发 会在项目根目录下提供 `Dockerfile` 用于构建镜像,提供 `docker-compose.yml` 用于开发
@ -45,7 +39,7 @@ docker run --rm --name webman \
-it \ -it \
--privileged -u root \ --privileged -u root \
--entrypoint /bin/sh \ --entrypoint /bin/sh \
krisss/docker-webman:7.4-cli-alpine https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
``` ```
创建项目 创建项目
@ -72,7 +66,7 @@ version: "3.7"
services: services:
webman: webman:
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine} image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
ports: ports:
- "${DOCKER_WEBMAN_PORT:-8787}:8787" - "${DOCKER_WEBMAN_PORT:-8787}:8787"
volumes: volumes:
@ -93,10 +87,10 @@ docker-compose up
在项目下自建 `Dockerfile`,参考例子如下: 在项目下自建 `Dockerfile`,参考例子如下:
```Dockerfile ```Dockerfile
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
# https://github.com/krissss/docker-webman # https://github.com/krissss/docker-webman
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION FROM heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
# 增加额外的扩展 # 增加额外的扩展
#RUN install-php-extensions imagick #RUN install-php-extensions imagick

View File

@ -1,8 +1,8 @@
# 用于将项目构建成镜像 # 用于将项目构建成镜像
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
# https://github.com/krissss/docker-webman # https://github.com/krissss/docker-webman
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION FROM https://git.des8.com/heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
# 增加额外的扩展 # 增加额外的扩展
#RUN apk add --no-cache git #RUN apk add --no-cache git

View File

@ -3,7 +3,7 @@ version: "3.7"
services: services:
webman: webman:
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine} image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-8.0-cli-alpine}
ports: ports:
- "${DOCKER_WEBMAN_PORT:-8787}:8787" - "${DOCKER_WEBMAN_PORT:-8787}:8787"
volumes: volumes: