cicd: copy contents instead of whole dir #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: Deployment | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- name: Build Static Files | |
run: | | |
pnpm install | |
pnpm build | |
- name: Delete Past Version Files | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOYMENT_HOST }} | |
username: ${{ secrets.DEPLOYMENT_HOST_USERNAME }} | |
key: ${{ secrets.DEPLOYMENT_HOST_KEY }} | |
port: 22 | |
script: | | |
rm -rf /var/www/html/* | |
- name: Send Files to Server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOYMENT_HOST }} | |
username: ${{ secrets.DEPLOYMENT_HOST_USERNAME }} | |
key: ${{ secrets.DEPLOYMENT_HOST_KEY }} | |
port: 22 | |
source: dist/* | |
target: /var/www/html/ | |
strip_components: 1 |