Merge pull request #297 from Veercodeprog/feature/Login-bonus-message… #198
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Fly on push to main | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build_check: | |
uses: ./.github/workflows/build-check.yml | |
with: | |
publish-artifact: true | |
deploy: | |
name: Deploy | |
needs: build_check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download build | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-musl | |
- run: chmod +x target/x86_64-unknown-linux-musl/release/hot-or-not-web-leptos-ssr | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Set secret tokens | |
run: | | |
flyctl secrets set CF_TOKEN="$CF_TOKEN" --app "hot-or-not-web-leptos-ssr" --stage | |
flyctl secrets set BACKEND_ADMIN_IDENTITY="$BACKEND_ADMIN_IDENTITY" --app "hot-or-not-web-leptos-ssr" --stage | |
flyctl secrets set COOKIE_KEY="$COOKIE_KEY" --app "hot-or-not-web-leptos-ssr" --stage | |
flyctl secrets set REDIS_URL="$REDIS_URL" --app "hot-or-not-web-leptos-ssr" --stage | |
flyctl secrets set GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET --app "hot-or-not-web-leptos-ssr" --stage | |
flyctl secrets set GRPC_AUTH_TOKEN="$GRPC_AUTH_TOKEN" --app "hot-or-not-web-leptos-ssr" --stage | |
env: | |
CF_TOKEN: ${{ secrets.CLOUDFLARE_STREAM_IMAGES_ANALYTICS_READ_WRITE_SECRET }} | |
BACKEND_ADMIN_IDENTITY: ${{ secrets.YRAL_WHITELISTED_BACKEND_GLOBAL_ADMIN_SECRET_KEY }} | |
COOKIE_KEY: ${{ secrets.AUTH_SESSION_COOKIE_SIGNING_SECRET_KEY }} | |
REDIS_URL: ${{ secrets.AUTH_FLY_IO_UPSTASH_REDIS_DATABASE_CONNECTION_STRING }} | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_SIGNING_OAUTH_CLIENT_CREDENTIAL_CLIENT_SECRET }} | |
FLY_API_TOKEN: ${{ secrets.HOT_OR_NOT_WEB_LEPTOS_SSR_FLY_IO_GITHUB_ACTION }} | |
GRPC_AUTH_TOKEN: ${{ secrets.OFF_CHAIN_AGENT_GRPC_AUTH_TOKEN }} | |
- name: Deploy a docker container to Fly.io | |
run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.HOT_OR_NOT_WEB_LEPTOS_SSR_FLY_IO_GITHUB_ACTION }} | |
# post_deploy: | |
# trigger automation test in another repo as post deploy action | |
- name: Trigger automation testing workflow in 'hot-or-not-web-leptos-ssr-e2e-test' repo | |
run: | | |
curl -X POST https://api.github.com/repos/go-bazzinga/hot-or-not-web-leptos-ssr-e2e-test/dispatches \ | |
-H 'Accept: application/vnd.github+json' \ | |
-H 'Authorization: token ${{ secrets.TOKEN_FINE_GRAINED_E2E_TESTS }}' \ | |
-d '{"event_type": "call"}' |