Revert "Add cache" #149
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: Deno | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Run checks | |
run: deno task ci | |
publish: | |
if: github.repository == 'AnInternetTroll/speedrunbot-slash' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
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 | |
uses: actions/checkout@v2 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
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: deno run --allow-all main.ts -u |