Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
a042ef8de6 | |||
ac0b90a1c1 | |||
4a53f20dc3 | |||
20aaed1f1c | |||
6cfa6e80fb | |||
95ffcdd3c8 | |||
a56aca42f4 | |||
fe24d4fad9 | |||
30d98896e7 | |||
226d70846b | |||
2ecdef7675 | |||
452b356321 | |||
feca5c9d3c | |||
25fe1f48c7 | |||
b7d9a17121 | |||
e090cfad10 | |||
8dddaafee3 | |||
5d444fc763 | |||
f287eeec5d | |||
7765d1cada | |||
b4b4274811 |
63
.github/workflows/docker-image.yml
vendored
63
.github/workflows/docker-image.yml
vendored
@ -2,7 +2,14 @@ name: Build Docker Image And Push
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: [ 'v*.*.*' ]
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
# on:
|
||||||
|
# push:
|
||||||
|
# tags: [ 'v*.*.*' ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PHP_EXTENSION_INSTALL_VERSION: 'latest'
|
PHP_EXTENSION_INSTALL_VERSION: 'latest'
|
||||||
@ -10,44 +17,47 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build PHP ${{ matrix.php-version }}
|
name: Build PHP 8.0
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
container:
|
container: catthehacker/ubuntu:act-latest
|
||||||
# 使用支持docker的act镜像
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
volumes:
|
|
||||||
# 缓存docker构建步骤
|
|
||||||
- ubuntu_dockercache:/opt/dockercache
|
|
||||||
env:
|
env:
|
||||||
PHP_CLI_VERSION: ${{ matrix.php-version }}-cli-alpine
|
PHP_CLI_VERSION: 8.0-cli-alpine
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ ubuntu-latest ]
|
|
||||||
php-version: ['8.0']
|
|
||||||
max-parallel: 8
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.HUB_PASSWORD }}
|
|
||||||
- name: Login to Git Docker Hub
|
- name: Login to Git Docker Hub
|
||||||
# https://github.com/docker/login-action#docker-hub
|
# https://github.com/docker/login-action#docker-hub
|
||||||
uses: docker/login-action@v3
|
uses: http://git.des8.com/docker/login-action@master
|
||||||
with:
|
with:
|
||||||
registry: git.des8.com
|
registry: git.des8.com
|
||||||
username: ${{ secrets.HUB_USERNAME }}
|
username: ${{ secrets.HUB_USERNAME }}
|
||||||
password: ${{ secrets.HUB_PASSWORD }}
|
password: ${{ secrets.HUB_PASSWORD }}
|
||||||
|
|
||||||
# - name: Get Meta
|
- name: Checkout
|
||||||
# id: meta
|
uses: http://git.des8.com/docker/checkout@main
|
||||||
# run: |
|
with:
|
||||||
# echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
username: ${{ secrets.HUB_USERNAME }}
|
||||||
# echo REPO_VERSION=$(echo ${{ github.ref }} | awk -F"/" '{print $3}' | awk -F"v" '{print $2}') >> $GITHUB_OUTPUT
|
password: ${{ secrets.HUB_PASSWORD }}
|
||||||
|
repository: heibai2006/webman-docker
|
||||||
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
|
|
||||||
|
- name: Set up Docker BuildX
|
||||||
|
uses: https://git.des8.com/docker/setup-buildx-action@v2.6.0
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||||
|
with:
|
||||||
|
images: ${{ secrets.HUB_USERNAME }}/webman-docker
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
# https://github.com/docker/build-push-action
|
# https://github.com/docker/build-push-action
|
||||||
uses: docker/build-push-action@v4
|
uses: http://git.des8.com/docker/build-push-action@master
|
||||||
|
env:
|
||||||
|
# 必需有且置空,查看官方文档解释:https://docs.gitea.com/zh-cn/next/usage/actions/comparison?_highlight=build&_highlight=push&_highlight=action#dockerbuild-push-actionv4
|
||||||
|
ACTIONS_RUNTIME_TOKEN: ''
|
||||||
with:
|
with:
|
||||||
|
username: ${{ secrets.HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.HUB_PASSWORD }}
|
||||||
|
repository: heibai2006/webman-docker
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
build-args: |
|
build-args: |
|
||||||
@ -58,3 +68,4 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}
|
${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}
|
||||||
${{ secrets.HUB_USERNAME }}/webman-docker:${{ 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) || '' }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
Loading…
Reference in New Issue
Block a user