Skip to content

Commit

Permalink
Add build and deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
gwllx committed Oct 18, 2023
1 parent 79449fd commit 1a868d5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build & Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm install
- run: npm run build
- run: mkdir -p ~/.ssh
- run: ssh-keyscan -t rsa ${{ secrets.DEPLOY_HOST }} > ~/.ssh/known_hosts
- run: chmod 0600 ~/.ssh/known_hosts
- run: echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
- run: chmod 0600 ~/.ssh/id_rsa
- run: |
rsync -rv --delete --exclude=".*" \
www/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:gwllx.co

0 comments on commit 1a868d5

Please sign in to comment.