-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (41 loc) · 1.34 KB
/
ci.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
name: CI
on:
create:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check theme version against tag
run: |
THEME_VERSION=$(cat sass/style.scss | grep Version | sed -r 's/version: +//I')
V="v"
echo $THEME_VERSION
echo ${GITHUB_REF##*/}
if [ "$V$THEME_VERSION" != "${GITHUB_REF##*/}" ]; then exit 1; fi
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install npm packages
run: npm install
- name: Build scss
run: npm run compile:build
- name: Build JS
run: npm run build
- name: run install composer
run: composer install
- name: Make bundle
run: npm run bundle
- name: provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
mkdir "$HOME/.ssh"
echo "$DEPLOY_KEY" > "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
- name: save version
run: echo ${GITHUB_REF##*/} > version.txt
- name: rsync zipfile, version and changelog
run: rsync -z -e "ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa" ../sunflower.zip version.txt changelog.html [email protected]:/var/www/sunflower-theme.de/updateserver/