diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index f10796d..16b0cdf 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 50 + fetch-depth: 1 - name: Check runner tools run: | @@ -49,7 +49,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 50 + fetch-depth: 1 - name: Check runner tools run: | @@ -73,6 +73,34 @@ jobs: DAGGER_NO_NAG: "1" run: task publish-android + - name: Cleanup TLS credentials + if: always() + run: rm -rf /tmp/dagger-tls /tmp/stunnel-dagger.conf /tmp/stunnel.pid + + deploy-apk: + name: Build & Deploy APK to Server + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Check runner tools + run: | + command -v dagger >/dev/null 2>&1 || { echo "ERROR: dagger is not installed in the runner image. Add it to .forgejo/Dockerfile."; exit 1; } + command -v task >/dev/null 2>&1 || { echo "ERROR: task is not installed in the runner image. Add it to .forgejo/Dockerfile."; exit 1; } + dpkg -s stunnel4 netcat-openbsd >/dev/null 2>&1 || { echo "ERROR: stunnel4/netcat-openbsd are not installed in the runner image. Add them to .forgejo/Dockerfile."; exit 1; } + + - name: Setup Dagger Remote Engine (via stunnel) + env: + DAGGER_STUNNEL_URL: ${{ secrets.DAGGER_STUNNEL_URL }} + DAGGER_CA_CERT: ${{ secrets.DAGGER_CA_CERT }} + DAGGER_CLIENT_CERT: ${{ secrets.DAGGER_CLIENT_CERT }} + DAGGER_CLIENT_KEY: ${{ secrets.DAGGER_CLIENT_KEY }} + run: scripts/setup_dagger_remote.sh + - name: Build & Deploy APK to server # continue-on-error: step requires SSH_PRIVATE_KEY secret; if unset the task # precondition fails, but we don't want that to fail the whole job — the Play @@ -100,7 +128,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 50 + fetch-depth: 1 - name: Check runner tools run: | @@ -137,16 +165,16 @@ jobs: publish-website: name: Publish Website Build History runs-on: ubuntu-latest - needs: [build-linux, deploy-playstore] + needs: [build-linux, deploy-playstore, deploy-apk] if: | always() && - (needs.build-linux.result == 'success' || needs.deploy-playstore.result == 'success') + (needs.build-linux.result == 'success' || needs.deploy-playstore.result == 'success' || needs.deploy-apk.result == 'success') timeout-minutes: 60 steps: - uses: actions/checkout@v4 with: - fetch-depth: 50 + fetch-depth: 1 - name: Check runner tools run: | @@ -180,7 +208,7 @@ jobs: label-deploy-health: name: Update Deploy Health Label runs-on: ubuntu-latest - needs: [test-android-firebase, deploy-playstore, build-linux] + needs: [test-android-firebase, deploy-playstore, deploy-apk, build-linux] if: always() && vars.DEPLOY_HEALTH_ISSUE != '' timeout-minutes: 5 @@ -190,7 +218,7 @@ jobs: FORGEJO_TOKEN: ${{ github.token }} FORGEJO_URL: ${{ github.server_url }} DEPLOY_HEALTH_ISSUE: ${{ vars.DEPLOY_HEALTH_ISSUE }} - ALL_SUCCEEDED: ${{ needs.test-android-firebase.result == 'success' && needs.deploy-playstore.result == 'success' && needs.build-linux.result == 'success' }} + ALL_SUCCEEDED: ${{ needs.test-android-firebase.result == 'success' && needs.deploy-playstore.result == 'success' && needs.deploy-apk.result == 'success' && needs.build-linux.result == 'success' }} run: | python3 - << 'PYEOF' import os, json, urllib.request, urllib.error