Skip to content

Add more flexibility to use with different PHP versions #26

Add more flexibility to use with different PHP versions

Add more flexibility to use with different PHP versions #26

Workflow file for this run

---
name: build and publish docker images
on:
release:
types: [released]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish-docker-image:
runs-on: ["ubuntu-latest"]
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
update-dst-repo:
runs-on: ["ubuntu-latest"]
needs: publish-docker-image
steps:
- name: Trigger Workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GHA_LOCAL_TOKEN_CODING_STANDARD }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'coding-standard',
workflow_id: 'release-from-upstream.yml',
ref: 'master',
inputs: {
versionToRelease: '${{ github.event.release.tag_name }}'
}
})