From 390d47e264612cb50a051e29a6394d864c2b239a Mon Sep 17 00:00:00 2001 From: Simone Bierti Date: Wed, 14 Jan 2026 19:10:46 +0100 Subject: [PATCH] =?UTF-8?q?aggiunge=20le=20funzionalit=C3=A0=20per=20la=20?= =?UTF-8?q?conferma=20della=20prenotazione=20e=20la=20pipeline=20gitea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/publish-package.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .gitea/workflows/publish-package.yml diff --git a/.gitea/workflows/publish-package.yml b/.gitea/workflows/publish-package.yml new file mode 100644 index 0000000..a9a2261 --- /dev/null +++ b/.gitea/workflows/publish-package.yml @@ -0,0 +1,51 @@ +name: Build and Publish + +on: + push: + branches: + - '**' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:java-tools-24.04 + steps: + - name: Checkout repository + uses: https://github.com/actions/checkout@v4 + + - name: Login al registry di Gitea + run: | + echo "${{ secrets.AUTHTOKEN }}" | docker login ${{ vars.REGISTRY_URL }} -u ${{ github.repository_owner }} --password-stdin + echo "${{ secrets.AUTHTOKEN }}" ${{ vars.REGISTRY_URL }} ${{ github.repository_owner }} + + - name: Build immagine Docker + run: | + IMAGE_NAME="${{ vars.REGISTRY_URL }}/${{ github.repository }}" + docker build \ + --target production \ + -t ${IMAGE_NAME}:${{ github.sha }} \ + -t ${IMAGE_NAME}:${{ github.ref_name}} \ + -t ${IMAGE_NAME}:latest \ + . + echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV + + - name: Push immagine Docker + run: | + docker push ${{ env.IMAGE_NAME }}:${{ github.sha }} + docker push ${{ env.IMAGE_NAME }}:${{ github.ref_name }} + docker push ${{ env.IMAGE_NAME }}:latest + echo "Docker image pushed successfully!" + + - name: Upload to Gitea Package Registry + run: | + VERSION="${GITHUB_REF_NAME:-main}" + REPO_NAME="${{ github.event.repository.name }}" + curl -X PUT \ + -H "Authorization: token ${{ secrets.AUTHTOKEN }}" \ + -T build-artifact.tar.gz \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/packages/generic/${REPO_NAME}/${VERSION}/build-artifact.tar.gz" + echo "Artifact uploaded to Package Registry!" + echo "Download at: ${{ github.server_url }}/${{ github.repository }}/-/packages" +