Skip to content

CI

CI #193

Workflow file for this run

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: '20.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/updateserver/