diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..f0f0fe4 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Build and Deploy API + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + container: + image: maven:3.9-eclipse-temurin-17 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Maven settings + run: | + mkdir -p ~/.m2 + cat > ~/.m2/settings.xml << 'SETTINGS' + + + + nexus + * + https://nexus.gc-si.dev/repository/maven-public/ + + + + + nexus + ${{ secrets.NEXUS_USERNAME }} + ${{ secrets.NEXUS_PASSWORD }} + + + + SETTINGS + + - name: Build + run: mvn clean package -DskipTests -B + + - name: Deploy to server + run: | + cp target/gc-guide-api-*.jar /deploy/api/app.jar + echo "Deployed at $(date '+%Y-%m-%d %H:%M:%S')" + ls -la /deploy/api/