diff options
author | Luca Matei Pintilie <luca@lucamatei.com> | 2024-03-31 15:47:54 +0000 |
---|---|---|
committer | Luca Matei Pintilie <luca@lucamatei.com> | 2024-03-31 15:52:10 +0000 |
commit | 05a18e8e729594b354f1f5ee93011aa5322d2698 (patch) | |
tree | edb272ae9cf06b9156c8a17cbba25e5ed5d5f2b2 | |
parent | f1bf51249ab4791a048b907a30a47c233f824166 (diff) | |
download | speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.tar speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.tar.gz speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.tar.bz2 speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.tar.lz speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.tar.xz speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.tar.zst speedrunbot-slash-05a18e8e729594b354f1f5ee93011aa5322d2698.zip |
Add deploy step in workflow
-rw-r--r-- | .github/workflows/deno.yml | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index ac7d3eb..6279664 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -29,6 +29,9 @@ jobs: env: TOKEN: ${{ secrets.TOKEN }} PUBLIC_KEY: ${{ secrets.PUBLIC_KEY }} + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} + DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }} + PROJECT_NAME: "speedrunbot" steps: - name: Setup repo @@ -39,5 +42,24 @@ jobs: with: deno-version: v1.x + - name: Deploy + run: | + deno install -Arf https://deno.land/x/deploy/deployctl.ts + + deployctl deploy \ + --prod \ + --color=never \ + --entrypoint="./main.ts" \ + --project=$PROJECT_NAME \ + --env=CLIENT_SECRET=$CLIENT_SECRET \ + --env=PUBLIC_KEY=$PUBLIC_KEY \ + --env=TOKEN=$TOKEN + + deployment_id="$(deployctl deployments list --project $PROJECT_NAME --format=json | jq -r '. |= sort_by(.createdAt) | reverse | .[].deployment.id' | head -n 1)" + deployctl deployments redeploy \ + --prod \ + --project=$PROJECT_NAME \ + --id="$deployment_id" + - name: Update commands - run: ./main.ts -u + run: deno run --allow-all main.ts -u |