Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliwenwenwen authored Apr 15, 2024
1 parent a563dfa commit 2f60a14
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy CI

on:
workflow_dispatch:

jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: pingcap-jp/yarn.lock
- name: Build
run: |
cd pingcap-jp
yarn install
yarn build:prod
- name: S3 sync
uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'pingcap-jp/dist'
DEST_DIR: 'dist'
- name: Deploy server
uses: easingthemes/ssh-deploy@main
with:
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
REMOTE_PORT: ${{ secrets.DEPLOY_PORT }}
SOURCE: 'pingcap-jp'
TARGET: ${{ secrets.DEPLOY_PATH }}
EXCLUDE: 'pingcap-jp/node_modules/'
SCRIPT_AFTER: sh ${{ secrets.DEPLOY_PATH }}/refresh.sh

0 comments on commit 2f60a14

Please sign in to comment.