-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
62 lines (52 loc) · 1.85 KB
/
Copy pathbuild-website.yml
File metadata and controls
62 lines (52 loc) · 1.85 KB
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
name: Build website
on:
push:
branches:
- master
workflow_dispatch:
jobs:
run-on-server:
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Copy runner file to remote server
uses: garygrossgarten/github-action-scp@0.9.0
with:
local: website/scripts/runner.mjs
remote: /var/www/core-js/runner.mjs
host: ${{ secrets.REMOTE_HOST }}
username: ci
privateKey: ${{ secrets.CI_SSH_KEY }}
- name: Copy runner wrapper file to remote server
uses: garygrossgarten/github-action-scp@0.9.0
with:
local: website/scripts/runner.sh
remote: /var/www/core-js/runner.sh
host: ${{ secrets.REMOTE_HOST }}
username: ci
privateKey: ${{ secrets.CI_SSH_KEY }}
- name: Copy runner helpers file to remote server
uses: garygrossgarten/github-action-scp@0.9.0
with:
local: website/scripts/helpers.mjs
remote: /var/www/core-js/helpers.mjs
host: ${{ secrets.REMOTE_HOST }}
username: ci
privateKey: ${{ secrets.CI_SSH_KEY }}
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.CI_SSH_KEY }}
- name: Make runner.sh executable on remote
run: |
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "chmod +x /var/www/core-js/runner.sh"
- name: Run node runner.mjs on remote server
run: |
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "cd /var/www/core-js/ && ./runner.sh"