webman-docker/.github/workflows/docker-image.yml
meng 4a53f20dc3
Some checks failed
Build Docker Image And Push / Build PHP 8.0 (push) Failing after 43s
吞吞吐吐
2024-03-15 14:12:28 +08:00

71 lines
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build Docker Image And Push
on:
push:
branches:
- main
pull_request:
branches:
- main
# on:
# push:
# tags: [ 'v*.*.*' ]
env:
PHP_EXTENSION_INSTALL_VERSION: 'latest'
COMPOSER_VERSION: 'latest'
jobs:
build:
name: Build PHP 8.0
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
env:
PHP_CLI_VERSION: 8.0-cli-alpine
steps:
- name: Login to Git Docker Hub
# https://github.com/docker/login-action#docker-hub
uses: http://git.des8.com/docker/login-action@master
with:
registry: git.des8.com
username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_PASSWORD }}
- name: Checkout
uses: http://git.des8.com/docker/checkout@main
with:
username: ${{ secrets.HUB_USERNAME }}
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
# https://github.com/docker/build-push-action
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:
username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_PASSWORD }}
repository: heibai2006/webman-docker
context: .
file: ./Dockerfile
build-args: |
PHP_CLI_VERSION=${{ env.PHP_CLI_VERSION }}
PHP_EXTENSION_INSTALL_VERSION=${{ env.PHP_EXTENSION_INSTALL_VERSION }}
COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}
push: true
tags: |
${{ 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) || '' }}
labels: ${{ steps.meta.outputs.labels }}