-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Deno Deploy] Add .github/workflows/deploy.yml
- Loading branch information
1 parent
db3caf5
commit b20ac50
Showing
1 changed file
with
34 additions
and
21 deletions.
There are no files selected for viewing
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
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" |