feat: ad dockerfile & ci for cd #2
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
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "22" | |
- name: Install and Build | |
run: | | |
yarn install | |
yarn build | |
- name: Upload to Deploy Server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SERVER_KEY }} | |
port: ${{ secrets.SERVER_PORT }} | |
source: './dist/*' | |
target: '/var/www/html' | |
overwrite: true | |
strip_components: 1 |