0.11.1219 #1030
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy municipio on modul-test | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout municipio repo | |
uses: actions/checkout@v3 | |
with: | |
repository: helsingborg-stad/Municipio | |
ref: 3.0/develop | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Setup PHP with composer v2 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
tools: composer:v2 | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Install composer dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Remove .npmrc and inject token | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc | |
- name: Execute buildscripts in themes and plugins folders | |
run: php ./build.php --cleanup | |
- name: Cleanup node_modules | |
run: rm -rf node_modules | |
- name: rsync deployment to www-data user. | |
uses: burnett01/[email protected] | |
with: | |
switches: -avzrog --rsync-path="sudo rsync" --delete --backup --backup-dir=${{ secrets.DEPLOY_REMOTE_BACKUP_DIR_MODUL_TEST_HELSINGBORG_IO }}/$GITHUB_SHA --chown=www-data:www-data --chmod=g+rw | |
path: . | |
remote_path: ${{ secrets.DEPLOY_REMOTE_PATH_MUNICIPIO_MODUL_TEST_HELSINGBORG_IO }} | |
remote_host: ${{ secrets.DEPLOY_REMOTE_HOST_MODUL_TEST_HELSINGBORG_IO }} | |
remote_user: ${{ secrets.DEPLOY_AWS_REMOTE_USER_MODUL_TEST_HELSINGBORG_IO}} | |
remote_key: ${{ secrets.DEPLOY_KEY_MODUL_TEST_HELSINGBORG_IO }} | |
- name: Clear varnish and redis object cache. | |
uses: appleboy/ssh-action@master | |
with: | |
script: | | |
cd ${{ secrets.DEPLOY_REMOTE_PATH_MODUL_TEST_HELSINGBORG_IO }} | |
wp varnish purge --allow-root | |
wp cache flush --allow-root | |
sudo rm ${{ secrets.DEPLOY_REMOTE_PATH_MODUL_TEST_HELSINGBORG_IO }}/wp-content/uploads/cache/blade-cache/** || true | |
host: ${{ secrets.DEPLOY_REMOTE_HOST_MODUL_TEST_HELSINGBORG_IO }} | |
username: ${{ secrets.DEPLOY_AWS_REMOTE_USER_MODUL_TEST_HELSINGBORG_IO }} | |
key: ${{ secrets.DEPLOY_KEY_MODUL_TEST_HELSINGBORG_IO }} |