-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (30 loc) · 874 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- uses: actions/checkout@v3
- name: Add ssh key
run: |
mkdir ~/.ssh
echo "${{ secrets.OPENSSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts
- name: Build
run: |
npm install
npm run build
- name: Deploy files with rsync
run: |
rsync -z --delete .dist/ root@${{secrets.HOST}}:/var/www/about-me/
- name: Clean up ssh files for some reason
run: |
rm ~/.ssh/id_rsa