update dependencies #23
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: Github Deploy | |
on: | |
push: | |
branches: [master] | |
jobs: | |
build-and-deploy: | |
env: | |
DESTINATION: "[email protected]" | |
runs-on: ubuntu-latest | |
steps: | |
# Pull repository into the current pipeline | |
- name: pull repository | |
uses: actions/checkout@v4 | |
# Setup container with private SSH Key (used by rsync) | |
- name: Loads private SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# Install PHP dependencies | |
- name: Composer install | |
run: composer install --prefer-dist --no-interaction --no-dev --no-progress --optimize-autoloader --ignore-platform-reqs | |
# Use a specific version of Node | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
# Install NPM dependencies | |
- name: NPM install | |
run: npm ci | |
# Run Gulp Build | |
- name: Gulp Build | |
run: npx gulp build | |
# Deploy Site | |
- name: Deploy with rsync | |
run: | | |
rsync -azh --delete-after --exclude-from='./.github/workflows/exclude.txt' -e 'ssh -o StrictHostKeyChecking=no' ./ --rsync-path='rsync' $DESTINATION:~/ | |
# Clear Kirby Cache | |
- name: Invalidate Cache | |
run: ssh $DESTINATION 'rm -f -r ~/site/cache/*' |