feat: 更新php8.3的base image #32
Workflow file for this run
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
name: Build And Release Docker Images | |
on: | |
push: | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- 'v*.*.*' | |
env: | |
IMAGE_NAME: laravel-elite-image | |
GITHUB_OWNER: larvatatw | |
DOCKERHUB_OWNER: larvata | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
# Publish `master` as Docker `latest` image. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
${{ env.DOCKERHUB_OWNER }}/${{ env.IMAGE_NAME }} | |
# ghcr.io/${{ env.GITHUB_OWNER }}/${{ env.IMAGE_NAME }} | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=semver,pattern={{version}} | |
type=match,prefix=latest-,pattern=php(.*) | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Save tag to env | |
run: | | |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV} | |
- name: Get correct version | |
run: | | |
VERSION=( 5.6 7.2 7.3 7.4 8.0 8.1 8.3) | |
for context in ${VERSION[@]}; do | |
if [ $(echo ${{env.TAG}} |grep -c "php${context}") = "1" ] | |
then | |
echo "CURRENT_VERSION=${context}" >> ${GITHUB_ENV} | |
break | |
fi | |
done | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64/v8 | |
context: ${{ env.CURRENT_VERSION }}/ | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |