add more configurable options via env vars #296
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: Test generated image | |
on: | |
push: | |
branches: | |
- "6.1.x" | |
pull_request: | |
branches: | |
- "6.1.x" | |
jobs: | |
meta: | |
runs-on: ubuntu-latest | |
outputs: | |
SHA: ${{ steps.vars.outputs.SHA }} | |
PLONE_VERSION: ${{ steps.vars.outputs.PLONE_VERSION }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Compute SHA value to be used in building the main image | |
id: vars | |
run: | | |
echo "SHA=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
echo "PLONE_VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT | |
test: | |
runs-on: ubuntu-latest | |
environment: DOCKER_HUB | |
needs: | |
- meta | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Builder Image | |
id: meta-builder | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
plone/server-builder | |
tags: | | |
type=sha | |
- name: Prod Config Image | |
id: meta-prod-config | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
plone/server-prod-config | |
tags: | | |
type=sha | |
- name: Main Image | |
id: meta-main | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
plone/plone-backend | |
tags: | | |
type=sha | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build builder image for testing | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
file: Dockerfile.builder | |
tags: ${{ steps.meta-builder.outputs.tags }} | |
push: true | |
build-args: | | |
PLONE_VERSION=${{ needs.meta.outputs.PLONE_VERSION }} | |
- name: Build prod-config image for testing | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
file: Dockerfile.prod | |
tags: ${{ steps.meta-prod-config.outputs.tags }} | |
push: true | |
- name: Build main image for testing | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
file: Dockerfile | |
tags: ${{ steps.meta-main.outputs.tags }} | |
push: true | |
build-args: | | |
PLONE_VERSION=${{ needs.meta.outputs.SHA }} | |
- name: Test | |
run: | | |
docker pull ${{ steps.meta-main.outputs.tags }} | |
./test/run.sh ${{ steps.meta-main.outputs.tags }} |