Skip to content

⬆️ Upgrade actions/cache digest to 2cdf405 (#628) #595

⬆️ Upgrade actions/cache digest to 2cdf405 (#628)

⬆️ Upgrade actions/cache digest to 2cdf405 (#628) #595

Workflow file for this run

name: Deploy to Live
on:
push:
branches:
- main
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
with:
php-version: '8.2'
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-dev --no-interaction
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: 20.x
- name: Enable Corepack
run: corepack enable
- name: Install Yarn dependencies
uses: borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5
with:
cmd: install
- name: Build production bundle
uses: borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5
with:
cmd: build
- name: Commit and push local changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_message: 🍱 Apply theme changes
deploy:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd einstein
git pull
php82 /usr/bin/composer install --no-dev -d ${PWD}