Skip to content

Commit

Permalink
Add build automation
Browse files Browse the repository at this point in the history
  • Loading branch information
corvus-ch committed Nov 25, 2024
1 parent c2e1d71 commit 14a958f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .ftpignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.log
.ddev
.editorconfig
.ftp*
.git*
.git*/**
docker*
composer.*
web/sites/*/files/
web/sites/*/settings.*.php
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
pull_request:
branches:
- trunk
push:
branches:
- trunk

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Setup Rclone
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: |
[remote]
type = sftp
host = ${{ secrets.FTP_SERVER }}
user = ${{ secrets.FTP_USER }}
port = ${{ secrets.FTP_PORT }}
# Password must be obfuscated using `rclone obfuscate`
pass = ${{ secrets.FTP_PASSWORD }}
shell_type = unix
md5sum_command = none
sha1sum_command = none
disable_base64: true

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer install
uses: php-actions/composer@v6
with:
dev: no
args: --ignore-platform-reqs --classmap-authoritative

- name: Dry run file upload
if: github.ref != 'refs/heads/trunk'
run: |
rclone -q --exclude-from .ftpignore --copy-links check --combined - . remote: 2>/dev/null | grep -vE '^= '
- name: Upload files
if: github.ref == 'refs/heads/trunk'
run: |
rclone -q --exclude-from .ftpignore --copy-links check . remote:

0 comments on commit 14a958f

Please sign in to comment.