CI: don't build the container image by default
All checks were successful
/ build (push) Successful in 20s

This commit is contained in:
phil 2024-11-02 05:30:27 +01:00
parent 056d86ca36
commit d552656e95

View file

@ -7,6 +7,11 @@ on:
required: false
default: false
type: boolean
build:
description: "Build container"
required: false
default: false
type: boolean
jobs:
build:
@ -34,11 +39,13 @@ jobs:
run: pytest -s tests/basic.py
- name: Workaround for bug of podman-login
if: ${{ inputs.build }}
run: |
mkdir -p $HOME/.docker
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
- name: Log in to container registry (with another workaround)
- name: Log in to the container registry (with another workaround)
if: ${{ inputs.build }}
uses: actions/podman-login@v1
with:
registry: ${{ vars.REGISTRY }}
@ -46,7 +53,8 @@ jobs:
password: ${{ secrets.REGISTRY_PASSWORD }}
auth_file_path: /tmp/auth.json
- name: Build container
- name: Build the container image
if: ${{ inputs.build }}
uses: actions/buildah-build@v1
with:
image: treetrail-backend
@ -54,7 +62,9 @@ jobs:
containerfiles: |
./Containerfile.for_runner
- uses: actions/push-to-registry@v2
- name: Push the image to the registry
uses: actions/push-to-registry@v2
if: ${{ inputs.build }}
with:
registry: "docker://${{ vars.REGISTRY }}"
image: treetrail-backend