-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (59 loc) · 1.68 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Deploy
on:
push:
branches: [$default-branch]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: self-hosted
container:
image: 'joel/alpine'
environment: vps
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup-node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- run: |
echo "${{ job.container.id }}"
echo "${{ vars }}"
- run: yarn install
- run: yarn build
- name: docker-cp
uses: tj-actions/docker-cp@v2
with:
container: ${{ job.container.id }}
source: './public'
destination: ${{ vars.output_path }}
local: true
# Additional options passed to [docker cp](https://docs.docker.com/engine/reference/commandline/cp/#options)
# options:
# - name: Copy repository contents via scp
# uses: c0c1/scp-action@v1.0
# with:
# host: ${{ secrets.HOST }}
# user: ${{ secrets.USERNAME }}
# port: ${{ secrets.PORT }}
# key: ${{ secrets.SSH_KEY }}
# source: './public'
# remote: '/var/www/joel.fm/build'
# - name: SSH action
# uses: tiyee/action-ssh@v1.0.1
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# port: ${{ secrets.PORT }}
# privateKey: ${{ secrets.SSH_KEY }}
# command: |
# cd /var/www/joel.fm &&
# rm -rf /var/www/joel.fm/html-test &&
# ./scripts/symlinks.sh