diff --git a/.gitea/workflows/publish-image.yml b/.gitea/workflows/publish-image.yml new file mode 100644 index 0000000..5eb26a6 --- /dev/null +++ b/.gitea/workflows/publish-image.yml @@ -0,0 +1,47 @@ +name: Publish image + +on: + push: + tags: + - '*' + workflow_dispatch: + inputs: + tag: + description: Image tag to publish (only used for manual runs) + required: false + default: manual + +jobs: + build-and-push: + runs-on: ready2blob-image + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Resolve image tag + id: vars + run: | + if [ "${{ github.ref_type }}" = "tag" ]; then + echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + else + echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + fi + + - name: Log in to git.azuze.fr registry + uses: docker/login-action@v3 + with: + registry: git.azuze.fr + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + git.azuze.fr/kawa/ready2blob:${{ steps.vars.outputs.tag }} + git.azuze.fr/kawa/ready2blob:latest