| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- name: Release
- on:
- push:
- branches: [ main ]
- workflow_dispatch:
- inputs:
- branch:
- description: 'Branch to build'
- required: true
- default: 'main'
- type: string
- jobs:
- build:
- name: Build
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.event.inputs.branch || github.ref }}
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '25'
- distribution: 'temurin'
- - name: Build with Gradle
- run: chmod +x ./gradlew && ./gradlew clean build -x test
- dockerize:
- name: Dockerize Application
- needs: build
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.event.inputs.branch || github.ref }}
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '25'
- distribution: 'temurin'
- - name: Build
- run: ./gradlew build
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- - name: Login to Docker Hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Build and Push Image
- run: |
- docker buildx create --use
- docker buildx build --platform linux/amd64,linux/arm64 -t dbohry/auth-service:latest --push .
- deploy:
- name: Deploy
- needs: dockerize
- runs-on: ubuntu-latest
- steps:
- - name: Trigger Portainer Webhook
- run: curl --location --request POST '${{ secrets.DEPLOY_WEBHOOK }}'
|