Skip to content

publishing version v3.0.0-beta-9 (#1149) #128

publishing version v3.0.0-beta-9 (#1149)

publishing version v3.0.0-beta-9 (#1149) #128

# .github/workflows/release.yml
name: Build Test for Sunflower 3.0 (on Push)
on:
push:
branches:
- sunflower2.0
env:
NODE_VERSION: 24
jobs:
build:
runs-on: ubuntu-latest
env:
PROJECT_ROOT: ${{ github.workspace }}/sunflower26
defaults:
run:
working-directory: ${{ env.PROJECT_ROOT }}
steps:
- uses: actions/checkout@v6
with:
path: sunflower26
- name: check theme version against tag
run: |
THEME_VERSION=$(cat sass/style.scss | grep Version | sed -r 's/version: +//I')
V="v"
echo Version in style.scss: $THEME_VERSION
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node_modules directory
uses: actions/cache@v5
id: npm-cache-dir
with:
path: sunflower26/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm packages
if: steps.npm-cache-dir.outputs.cache-hit != 'true'
run: npm ci
- name: Lint SCSS
run: npm run lint:scss
- name: Build CSS
run: npm run compile:css
- name: Build CSS-RTL
run: npm run compile:rtl
- name: Lint JS
run: npm run lint:js
- name: Build JS
run: npm run build
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: cs2pr
- name: run install composer
run: |
composer install
cd lib && composer install
- name: Run PHPCS checks
id: phpcs
continue-on-error: true
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml .
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml
- name: Make bundle
run: npm run bundle
- name: Rename ZIP file
run: |
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
BRANCH_NAME=${GITHUB_REF##*/}
mv ../sunflower26.zip sunflower26-${BRANCH_NAME}-${SHORT_SHA}.zip
- name: Provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY_DEV }}
SSH_USER: 'github-ci'
SSH_HOST: 'wordpress71.gcms.verdigado.net'
run: |
mkdir "$HOME/.ssh"
echo "$DEPLOY_KEY" > "$HOME/.ssh/dev-server.key"
chmod 600 "$HOME/.ssh/dev-server.key"
cat >> ~/.ssh/config <<END
Host dev-server
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/dev-server.key
StrictHostKeyChecking no
END
- name: rsync zipfile
run: |
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
BRANCH_NAME=${GITHUB_REF##*/}
rsync sunflower26-${BRANCH_NAME}-${SHORT_SHA}.zip dev-server:/var/www/updateserver/
ssh dev-server "cd /var/www && rm -fr wp-content/themes/sunflower26/ && wp theme install updateserver/sunflower26-${BRANCH_NAME}-${SHORT_SHA}.zip >> /tmp/sunflower-install.log"
mkdocs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v6
- name: mkdocs build
uses: Tiryoh/actions-mkdocs@v0
with:
mkdocs_version: 'latest' # option
# mkdocs_version: '1.1' # option
requirements: 'mkdocs/requirements.txt' # option
configfile: 'mkdocs/mkdocs.yml' # option
- name: Provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USER: 'github-ci'
SSH_HOST: 'wordpress05.gcms.verdigado.net'
run: |
mkdir "$HOME/.ssh"
echo "$DEPLOY_KEY" > "$HOME/.ssh/production.key"
chmod 600 "$HOME/.ssh/production.key"
cat >> ~/.ssh/config <<END
Host production
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/production.key
StrictHostKeyChecking no
END
- name: save version
run: echo ${GITHUB_REF##*/} > version.txt
- name: rsync documentation
run: rsync -a --delete documentation/* production:/var/www/documentation26/