mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-23 00:20:40 +07:00
test vps deployment
This commit is contained in:
1 parent
1e747b5cb2
commit
6bd11a3d05
1 file changed
+31
-18
+31
-18
@@ -17,29 +17,42 @@ jobs:
|
|||||||
runtime: node@24
|
runtime: node@24
|
||||||
- run: node --version
|
- run: node --version
|
||||||
- run: pnpm build
|
- run: pnpm build
|
||||||
|
# - uses: GuillaumeFalourd/setup-rsync@v1.2
|
||||||
|
# - run: rsync --version
|
||||||
- name: List files in the repository
|
- name: List files in the repository
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
ls ${{ gitea.workspace }}
|
||||||
- name: List files in dist
|
- name: List files in dist
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}/dist
|
ls ${{ gitea.workspace }}/dist
|
||||||
- name: Install SSH key
|
# - name: Install SSH key
|
||||||
uses: webfactory/ssh-agent@v0.10.0
|
# uses: webfactory/ssh-agent@v0.10.0
|
||||||
|
# with:
|
||||||
|
# ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
||||||
|
#
|
||||||
|
# - name: Add VPS to known_hosts
|
||||||
|
# run: |
|
||||||
|
# mkdir -p ~/.ssh
|
||||||
|
#
|
||||||
|
# ssh-keyscan \
|
||||||
|
# -p "${{ secrets.DEPLOY_SSH_PORT }}" \
|
||||||
|
# "${{ secrets.DEPLOY_HOST }}" \
|
||||||
|
# >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: rsync deployments
|
||||||
|
uses: burnett01/rsync-deployments@v9
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
switches: -avzr --delete
|
||||||
|
path: src/
|
||||||
|
remote_path: /opt/static-site/.incoming/ # ex: /var/www/html/
|
||||||
|
remote_host: ${{ secrets.DEPLOY_HOST }} # ex: example.com
|
||||||
|
remote_port: ${{ secrets.DEPLOY_SSH_PORT }} # ex: 22
|
||||||
|
remote_user: ${{ secrets.DEPLOY_USER }} # ex: ubuntu
|
||||||
|
remote_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Add VPS to known_hosts
|
# - name: Upload build
|
||||||
run: |
|
# run: |
|
||||||
mkdir -p ~/.ssh
|
# rsync -az --delete \
|
||||||
|
# -e "ssh -p ${{ secrets.DEPLOY_SSH_PORT }}" \
|
||||||
ssh-keyscan \
|
# dist/ \
|
||||||
-p "${{ secrets.DEPLOY_SSH_PORT }}" \
|
# "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/opt/static-site/.incoming/"
|
||||||
"${{ secrets.DEPLOY_HOST }}" \
|
|
||||||
>> ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: Upload build
|
|
||||||
run: |
|
|
||||||
rsync -az --delete \
|
|
||||||
-e "ssh -p ${{ secrets.DEPLOY_SSH_PORT }}" \
|
|
||||||
dist/ \
|
|
||||||
"${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/opt/static-site/.incoming/"
|
|
||||||
Reference in new issue
Block a user