diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 83c2b56..c785412 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -1,5 +1,12 @@ on: push: + workflow_dispatch: + inputs: + build: + description: "Build container" + required: false + default: false + type: boolean jobs: build: @@ -24,20 +31,28 @@ jobs: - name: Build package (transpile ts => js) run: ng build + - name: Get the version from git + id: version + if: ${{ inputs.build }} + run: echo "version=$(git describe --dirty --tags)" >> $GITHUB_OUTPUT + - name: Build container + if: ${{ inputs.build }} uses: actions/buildah-build@v1 with: image: treetrail-frontend - #tags: foo # v1 ${{ github.sha }} + tags: ${{ steps.version.outputs.version }} containerfiles: | ./Containerfile - 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) + if: ${{ inputs.build }} uses: actions/podman-login@v1 with: registry: ${{ vars.REGISTRY }} @@ -46,7 +61,8 @@ jobs: auth_file_path: /tmp/auth.json - uses: actions/push-to-registry@v2 + if: ${{ inputs.build }} with: registry: "docker://${{ vars.REGISTRY }}" image: treetrail-frontend - tags: latest + tags: ${{ steps.version.outputs.version }}