Files
git.planetrenox.com/.github/workflows/deploy.yml
2025-09-11 02:38:25 -07:00

24 lines
1.4 KiB
YAML

on:
workflow_dispatch:
inputs:
app:
description: 'App to deploy'
required: true
type: choice
options: [gitea, runner]
jobs:
deploy:
runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
GITEA_APP_NAME: ${{ secrets.FLY_APP_NAME }}
RUNNER_APP_NAME: ${{ secrets.RUNNER_APP_NAME }}
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- if: github.event.inputs.app == 'gitea'
run: flyctl apps create ${{ env.GITEA_APP_NAME }} --org personal || true; flyctl volumes create gitea_data --size 1 -a ${{ env.GITEA_APP_NAME }} || true; flyctl secrets set -a ${{ env.GITEA_APP_NAME }} GITEA__server__DOMAIN=${{ env.GITEA_APP_NAME }}.fly.dev GITEA__server__ROOT_URL=https://${{ env.GITEA_APP_NAME }}.fly.dev; flyctl deploy --remote-only -a ${{ env.GITEA_APP_NAME }} -c fly.toml
- if: github.event.inputs.app == 'runner'
run: flyctl apps create ${{ env.RUNNER_APP_NAME }} --org personal || true; flyctl volumes create runner_data --size 1 -a ${{ env.RUNNER_APP_NAME }} || true; flyctl secrets set -a ${{ env.RUNNER_APP_NAME }} GITEA_INSTANCE_URL=https://${{ env.GITEA_APP_NAME }}.fly.dev GITEA_RUNNER_REGISTRATION_TOKEN='${{ secrets.GITEA_RUNNER_REGISTRATION_TOKEN }}'; flyctl deploy --remote-only -a ${{ env.RUNNER_APP_NAME }} -c runner/fly.toml