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 docker image | |
on: | |
push: | |
branches: | |
- master | |
- 6.x | |
- add_docker_image | |
release: | |
types: | |
- published | |
permissions: | |
contents: read | |
jobs: | |
pre_job: | |
permissions: | |
actions: write | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
concurrent_skipping: always | |
cancel_others: true | |
do_not_skip: '["release"]' | |
# list files that may affect or are included into the built phar | |
paths: '["bin/**", "assets/**", "build/**", "dictionaries/**", "src/**", "stubs/**", "psalm", "psalm-language-server", "psalm-plugin", "psalm-refactor", "psalm-review", "psalter", "box.json.dist", "composer.json", "config.xsd", "keys.asc.gpg", "scoper.inc.php"]' | |
build-docker: | |
permissions: | |
packages: write | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
tools: composer:v2 | |
coverage: none | |
env: | |
fail-fast: true | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # required for composer to automatically detect root package version | |
- name: Upload docker image | |
env: | |
EVENT_NAME: ${{ github.event_name }} | |
REF: ${{ github.ref }} | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
php bin/ci/build-docker.php |