Skip to content

Commit

Permalink
[Deno Deploy] Add .github/workflows/deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
deno-deploy[bot] authored Mar 25, 2024
1 parent db3caf5 commit b20ac50
Showing 1 changed file with 34 additions and 21 deletions.
55 changes: 34 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
name: Deploy

on:
workflow_run:
workflows: [Sync To Gitee]
types:
- completed
push:
branches: main
pull_request:
branches: main

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: Deploy to remote server
uses: appleboy/ssh-action@master
- name: Clone repository
uses: actions/checkout@v3

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

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install step
run: "pnpm i"

- name: Build step
run: "pnpm build"

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
script: |
cd ${{ secrets.REMOTE_WORKDIR }}
git reset --hard origin/main
git pull
pnpm install
pnpm build
echo "${{ secrets.DEPLOY_ENV_FILE }}" > .env
echo "${{ secrets.DEPLOY_ENV_PROD_FILE }}" > .env.production
pnpm prod:pm2
project: "nest-admin"
entrypoint: "dist/main.js"
root: "dist"

0 comments on commit b20ac50

Please sign in to comment.