-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.43 KB
/
build_and_publish.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
name: Build and Release
on:
release:
types: [created]
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
# Check out the repository
- name: Check out the code
uses: actions/checkout@v3
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Use the Node.js version your project requires
# Install dependencies
- name: Install dependencies
run: |
npm install --global yarn
yarn install
# Build the project
- name: Build the project
run: npm run build
# Zip the project
- name: Build the project
run: zip -r build.zip build/
# Set up the GitHub CLI
- name: Install GitHub CLI
run: sudo apt-get install gh
# Upload files to release
- name: Upload ZIP file to Release
run: gh release upload "${{ github.event.release.tag_name }}" "build.zip" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Send to the server
- name: Update the Server Side
uses: appleboy/ssh-action@v1.1.0
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: ./update_web_from_release.sh