-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (31 loc) · 1.4 KB
/
_build-prod-image-php.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# To use this and subsequent jobs you need to fulfill all following requirements:
# 1. Create REGISTRY_NAME configuration variable in your GitHub (see https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository),
# e.g. for a GCP the variable should have a value "{LOCATION}-docker.pkg.dev/{PROJECT-ID}/{REPOSITORY}" (see https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling#tag)
# 2. Make sure your self-hosted GitHub runner is authenticated to your registry provider and has sufficient rights to push.
# (e.g. for a GCP see https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling#auth)
on:
workflow_call:
inputs:
image-name:
required: true
type: string
jobs:
php:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and load to local docker images - php
uses: docker/build-push-action@v3
with:
context: .
file: .docker/php/Dockerfile
target: deployment
tags: ${{ inputs.image-name }}/php
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
build-args: |
symfony_mode=prod