From f59e81a6989eaf64d0cfcf2b34e7d572ca559887 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Tue, 17 Sep 2024 23:45:18 +0200 Subject: [PATCH] add CD script Signed-off-by: Peter Siegmund --- .github/workflows/deploy-hetzner.yaml | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy-hetzner.yaml diff --git a/.github/workflows/deploy-hetzner.yaml b/.github/workflows/deploy-hetzner.yaml new file mode 100644 index 0000000..a983525 --- /dev/null +++ b/.github/workflows/deploy-hetzner.yaml @@ -0,0 +1,39 @@ +--- +name: 'deploy to hetzner' + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Cloning repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: gradle + + - name: Build with Gradle (no Testing) + run: ./gradlew clean build -x test + + - name: Push to dokku + timeout-minutes: 20 + uses: dokku/github-action@v1 + with: + branch: main + git_remote_url: ${{ secrets.HETZNER_GIT_URI }} + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + git_push_flags: --force