Skip to content

Commit 1a7bdfb

Browse files
authored
Update static.yml
1 parent 5f65592 commit 1a7bdfb

File tree

1 file changed

+39
-32
lines changed

1 file changed

+39
-32
lines changed

.github/workflows/static.yml

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
1-
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
1+
name: Deploy to Reg.Ru Hosting
32

43
on:
5-
# Runs on pushes targeting the default branch
64
push:
7-
branches: ["master"]
5+
branches: [main]
86

9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
7+
env:
8+
SERVER_HOST: "31.31.198.56"
9+
USERNAME: "u2970963"
10+
PASSWORD: ${{ secrets.SSH_PASSWORD_REGRU }}
11+
DEPLOY_PATH: /www/otk-help.martinmeer.com
1112

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13-
permissions:
14-
contents: read
15-
pages: write
16-
id-token: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
1719

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20-
concurrency:
21-
group: "pages"
22-
cancel-in-progress: false
20+
- name: Install dependencies
21+
run: |
22+
npm install
23+
24+
- name: Build project
25+
run: |
26+
npm run build
27+
28+
- name: Archive production artifacts
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: dist
32+
path: ./dist
2333

24-
jobs:
25-
# Single deploy job since we're just deploying
2634
deploy:
27-
environment:
28-
name: github-pages
29-
url: ${{ steps.deployment.outputs.page_url }}
35+
needs: build
3036
runs-on: ubuntu-latest
3137
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v4
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
38+
- name: Download artifacts
39+
uses: actions/download-artifact@v3
3840
with:
39-
# Upload entire repository
40-
path: '.'
41-
- name: Deploy to GitHub Pages
42-
id: deployment
43-
uses: actions/deploy-pages@v4
41+
name: dist
42+
43+
- name: Install sshpass
44+
run: sudo apt-get update && sudo apt-get install -y sshpass
45+
46+
- name: Copy files to server
47+
env:
48+
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD_REGRU }}
49+
run: |
50+
sshpass -p $SSH_PASSWORD scp -r dist/* $USERNAME@$SERVER_HOST:$DEPLOY_PATH

0 commit comments

Comments
 (0)