Skip to content

Merge branch 'development' #169

Merge branch 'development'

Merge branch 'development' #169

Workflow file for this run

name: Update Dependencies
on:
# On push or after every 7 days
push:
branches: [ master ]
schedule:
- cron: "0 0 1/7 * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: "18.x"
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: intl zip
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit == false }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Composer Install Upto Date Packages
run: composer install --no-dev --no-interaction --no-progress --optimize-autoloader --prefer-dist
- name: Commit
run: |
git config --local user.email "richard@tyganeutronics.com"
git config --local user.name "Richard Muvirimi"
git add -A
git status | grep "nothing to commit" || git commit -m "Update dependencies" -a
git pull --rebase
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Prepare Deploy
run: rsync -rvzt --include 'vendor' --include 'resources/views' --include 'public_html/build' --exclude-from=.gitignore --exclude '.git' --exclude '.github' --exclude '.vscode' --exclude 'resources/js/' ./ ./distribution/
- name: Deploy
uses: SamKirkland/FTP-Deploy-Action@4.3.2
with:
local-dir: distribution/
server-dir: ${{ secrets.DEPLOY_PATH }}
server: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
password: ${{ secrets.DEPLOY_PASSWORD }}
port: ${{ secrets.DEPLOY_PORT }}