diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 1a9d15e..7c5f54c 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -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