Files
smartbooking/.gitea/workflows/publish-package.yml
Simone Bierti f61e9b512c
All checks were successful
Build and Publish / build (push) Successful in 3m1s
conclude la sistemazione della pipeline gitea
2026-01-30 11:06:24 +01:00

37 lines
1.3 KiB
YAML

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 }}"
./gradlew bootJar jibDockerBuild -x test -Pprod --image=${IMAGE_NAME}:${{ github.sha }}
docker tag ${IMAGE_NAME}:${{ github.sha }} ${IMAGE_NAME}:${{ github.ref_name}}
docker tag ${IMAGE_NAME}:${{ github.sha }} ${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!"