CI: don't build the container image by default
All checks were successful
/ build (push) Successful in 20s
All checks were successful
/ build (push) Successful in 20s
This commit is contained in:
parent
056d86ca36
commit
d552656e95
1 changed files with 13 additions and 3 deletions
|
@ -7,6 +7,11 @@ on:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
build:
|
||||||
|
description: "Build container"
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -34,11 +39,13 @@ jobs:
|
||||||
run: pytest -s tests/basic.py
|
run: pytest -s tests/basic.py
|
||||||
|
|
||||||
- name: Workaround for bug of podman-login
|
- name: Workaround for bug of podman-login
|
||||||
|
if: ${{ inputs.build }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p $HOME/.docker
|
mkdir -p $HOME/.docker
|
||||||
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
|
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
|
uses: actions/podman-login@v1
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.REGISTRY }}
|
registry: ${{ vars.REGISTRY }}
|
||||||
|
@ -46,7 +53,8 @@ jobs:
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
auth_file_path: /tmp/auth.json
|
auth_file_path: /tmp/auth.json
|
||||||
|
|
||||||
- name: Build container
|
- name: Build the container image
|
||||||
|
if: ${{ inputs.build }}
|
||||||
uses: actions/buildah-build@v1
|
uses: actions/buildah-build@v1
|
||||||
with:
|
with:
|
||||||
image: treetrail-backend
|
image: treetrail-backend
|
||||||
|
@ -54,7 +62,9 @@ jobs:
|
||||||
containerfiles: |
|
containerfiles: |
|
||||||
./Containerfile.for_runner
|
./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:
|
with:
|
||||||
registry: "docker://${{ vars.REGISTRY }}"
|
registry: "docker://${{ vars.REGISTRY }}"
|
||||||
image: treetrail-backend
|
image: treetrail-backend
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue