-
-
Notifications
You must be signed in to change notification settings - Fork 106
35 lines (33 loc) · 970 Bytes
/
staging.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
name: Deploy Kitsu to staging environment
on:
push:
branches:
- master
jobs:
build:
if: github.repository_owner == 'cgwire'
name: Build
runs-on: ubuntu-latest
steps:
- name: Update Kitsu on staging server
uses: appleboy/[email protected]
env:
HUSKY: 0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script_stop: true
envs: HUSKY
script: |
cd /opt/kitsu
git pull
npm ci
npm run build
GIT_COMMIT="$(git rev-parse HEAD)"
GIT_TAG="$(git describe --tags)"
KITSU_VERSION="$(echo ${GIT_TAG} | sed 's/^v//;s/-build//')"
echo "${KITSU_VERSION}" > dist/.version.txt
echo "${GIT_COMMIT}" > dist/.commit.txt
echo "${GIT_TAG}" > dist/.tag.txt