-
Notifications
You must be signed in to change notification settings - Fork 12
45 lines (41 loc) · 1.26 KB
/
deploy_preprod.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
name: Deploy pre-prod
on:
push:
branches: [ dev ]
jobs:
build:
name: ssh/pull/build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Extract the version from package.json
- name: Get version from package.json
id: get_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Pull code & Build
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
eval `ssh-agent -s`
ssh-add ~/.ssh/${{ secrets.SSH_PUBLIC_KEY_NAME }}
cd ${{ secrets.DEV_DIST }}
git pull origin dev
npm ci
npm run build
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_BETA }}
DISCORD_USERNAME: "Github Monitoring"
DISCORD_AVATAR: "https://i.imgur.com/lPRYnJx.png"
uses: Ilshidur/action-discord@master
with:
args: |
**${{ github.repository }}** has been deployed on beta.squadcalc.app
**Commit**: ${{ github.event.head_commit.message }}