diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bf1087a..07bd9e1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,11 +13,11 @@ jobs: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} GITEA_APP_NAME: ${{ vars.GITEA_APP_NAME }} RUNNER_APP_NAME: ${{ vars.RUNNER_APP_NAME }} + GITEA_RUNNER_REGISTRATION_TOKEN: ${{ secrets.GITEA_RUNNER_REGISTRATION_TOKEN }} steps: - uses: actions/checkout@v4 - uses: superfly/flyctl-actions/setup-flyctl@master - - env: - GITEA_TOKEN: ${{ secrets.GITEA_RUNNER_REGISTRATION_TOKEN }} - run: | - [ "${{ github.event.inputs.app }}" = "gitea" ] && (flyctl apps create $GITEA_APP_NAME --org personal || true; flyctl volumes create gitea_data --size 1 -a $GITEA_APP_NAME || true; flyctl secrets set GITEA__server__DOMAIN=$GITEA_APP_NAME.fly.dev GITEA__server__ROOT_URL=https://$GITEA_APP_NAME.fly.dev -a $GITEA_APP_NAME; flyctl deploy --remote-only -a $GITEA_APP_NAME -c fly.toml) - [ "${{ github.event.inputs.app }}" = "runner" ] && (flyctl apps create $RUNNER_APP_NAME --org personal || true; flyctl volumes create runner_data --size 1 -a $RUNNER_APP_NAME || true; flyctl secrets set GITEA_INSTANCE_URL=https://$GITEA_APP_NAME.fly.dev "GITEA_RUNNER_REGISTRATION_TOKEN=$GITEA_TOKEN" -a $RUNNER_APP_NAME; flyctl deploy --remote-only -a $RUNNER_APP_NAME -c runner/fly.toml) + - if: github.event.inputs.app == 'gitea' + run: flyctl apps create "$GITEA_APP_NAME" --org personal || true; flyctl volumes create gitea_data --size 1 --region lax -a "$GITEA_APP_NAME" || true; flyctl secrets set GITEA__server__DOMAIN=$GITEA_APP_NAME.fly.dev GITEA__server__ROOT_URL=https://$GITEA_APP_NAME.fly.dev -a "$GITEA_APP_NAME"; flyctl deploy --remote-only -a "$GITEA_APP_NAME" -c fly.toml + - if: github.event.inputs.app == 'runner' + run: flyctl apps create "$RUNNER_APP_NAME" --org personal || true; flyctl volumes create runner_data --size 1 --region lax -a "$RUNNER_APP_NAME" || true; flyctl secrets set GITEA_INSTANCE_URL=https://$GITEA_APP_NAME.fly.dev "GITEA_RUNNER_REGISTRATION_TOKEN=$GITEA_RUNNER_REGISTRATION_TOKEN" -a "$RUNNER_APP_NAME"; flyctl deploy --remote-only -a "$RUNNER_APP_NAME" -c runner/fly.toml