-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.18 KB
/
deploy.workflow.yml
File metadata and controls
42 lines (35 loc) · 1.18 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
name: Deploy
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Deploying to Edmund
uses: appleboy/ssh-action@master #an action made to control linux servers
with: #setting secrets
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
set -e # Exit on error
cd ${{ secrets.WORK_DIR }}
# Set up Git to use the Personal Access Token
git config --global user.name "GitHub Actions Bot"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.ACCESS_TOKEN_TO_GIT }}@github.com/${{ github.repository }}.git
# Pull changes
git checkout ${{ vars.MAIN_BRANCH }}
git reset --hard HEAD
git pull
# Install dependencies and build the project
npm install
npm run build
exit