CI: build container when the version is a clean git tag 8

This commit is contained in:
phil 2024-11-03 18:31:25 +01:00
parent 3fc7a60bc5
commit eecb3b98c4

View file

@ -22,14 +22,14 @@ jobs:
- name: Check if the container should be built - name: Check if the container should be built
id: builder id: builder
run: echo "run=toJSON(${{ inputs.build || !contains(steps.version.output.version, '-')) }}" >> $GITHUB_OUTPUT run: echo "run=toJSON(${{ inputs.build || !contains(steps.version.outputs.version, '-')) }}" >> $GITHUB_OUTPUT
- name: Check - name: Check
run: | run: |
echo version echo version
echo '${{ steps.version.output.version }}' echo '${{ steps.version.outputs.version }}'
echo Build echo Build
echo '${{ fromJSON(steps.builder.output.run)}}' echo '${{ fromJSON(steps.builder.outputs.run)}}'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
name: Install pnpm name: Install pnpm
@ -53,7 +53,7 @@ jobs:
# run: git pull --unshallow # run: git pull --unshallow
- name: Build container - name: Build container
if: fromJSON(steps.builder.output.run) if: fromJSON(steps.builder.outputs.run)
uses: actions/buildah-build@v1 uses: actions/buildah-build@v1
with: with:
image: treetrail-frontend image: treetrail-frontend
@ -64,13 +64,13 @@ jobs:
./Containerfile ./Containerfile
- name: Workaround for bug of podman-login - name: Workaround for bug of podman-login
if: fromJSON(steps.builder.output.run) if: fromJSON(steps.builder.outputs.run)
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 container registry (with another workaround)
if: fromJSON(steps.builder.output.run) if: fromJSON(steps.builder.outputs.run)
uses: actions/podman-login@v1 uses: actions/podman-login@v1
with: with:
registry: ${{ vars.REGISTRY }} registry: ${{ vars.REGISTRY }}
@ -79,7 +79,7 @@ jobs:
auth_file_path: /tmp/auth.json auth_file_path: /tmp/auth.json
- uses: actions/push-to-registry@v2 - uses: actions/push-to-registry@v2
if: fromJSON(steps.builder.output.run) if: fromJSON(steps.builder.outputs.run)
with: with:
registry: "docker://${{ vars.REGISTRY }}" registry: "docker://${{ vars.REGISTRY }}"
image: treetrail-frontend image: treetrail-frontend