Skip to content

Commit

Permalink
feat(deploy): Adiciona staging deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenome committed Oct 26, 2023
1 parent 468cda9 commit fcb54b9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deno-deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deno Deploy (Staging)
on:
pull_request:
paths: ['web/**', '.github/workflows/deno-deploy.yml']

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install dependencies
working-directory: ./web
run: yarn

- name: Build Astro
working-directory: ./web
env:
MONGO_URI: ${{secrets.MONGO_URI}}
run: yarn run build

- uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- id: deploy
name: Upload to Deno Deploy
working-directory: ./web
run: |
deno install --allow-all --no-check -r -f https://deno.land/x/deploy/deployctl.ts
cd dist
echo "staging_hash=$(deployctl deploy --project=${{secrets.DENO_DEPLOY_PROJECT}} --token=${{secrets.DENO_DEPLOY_TOKEN}} ./server/entry.mjs | awk -F'[-.]' '/deno.dev/{print $3}')" >> $GITHUB_OUTPUT
- uses: actions/github-script@v6
with:
script: |
core.info('Disponível em http://${{secrets.DENO_DEPLOY_PROJECT}}-${{steps.deploy.outputs.staging_hash}}.deno.dev')

0 comments on commit fcb54b9

Please sign in to comment.