Dry-Run Deploy #17
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
# With this workflow, whenever you publish a new release, | |
# GitHub will trigger the workflow and run the deploy job, | |
# which will install the dependencies, build the project, | |
# and deploy the new or updated files to the remote server. | |
name: Dry-Run Deploy | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Prepare auth Token | |
run: composer global config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
- name: Get latest commit ID from ft-platform-collection | |
id: platform-collection | |
run: | | |
echo "commit_id={$(git ls-remote https://github.com/figuren-theater/ft-platform-collection.git refs/heads/main | awk '{ print $1 }')}" >> $GITHUB_OUTPUT | |
- 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-${{ github.sha }}-${{ steps.platform-collection.outputs.commit_id }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install composer dependencies | |
run: composer install --no-dev --prefer-dist --no-interaction | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install all platform dependencies | |
run: composer require figuren-theater/ft-platform-collection --update-no-dev --prefer-dist --no-interaction | |
# Help moving files (which koodimoni/dropin-installer is not capable for, see #11) | |
- name: Copy files (accompanying koodimoni) | |
run: | | |
cp content/mu-plugins/FT/ft-data/templates/htdocs/vendor/rss-bridge/rss-bridge/whitelist.txt vendor/rss-bridge/rss-bridge/whitelist.txt && | |
cp content/mu-plugins/FT/ft-maintenance/templates/htdocs/wp-content/db-error.php content/db-error.php && | |
cp content/mu-plugins/FT/ft-maintenance/templates/htdocs/wp-content/maintenance.php content/maintenance.php && | |
cp content/plugins/sqlite-object-cache/assets/drop-in/object-cache.php content/object-cache.php | |
- name: Zip artifact | |
run: zip release.zip ./* -r | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ft-platform-release | |
path: release.zip | |
- name: Deploy | |
uses: SamKirkland/[email protected] | |
with: | |
dry-run: true | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
protocol: ftps | |
port: 21 | |
timeout: 180000 # 3 min | |
exclude: | | |
tmp | |
**/.git* | |
**/.git*/** | |
**/node_modules/** | |
**/wp-content/plugins/** | |
**/wp-content/themes/** | |
**/.editorconfig | |
**/composer.lock | |
**/README.md | |
**/wp-config.local.php | |
**/wp-config.staging.php | |
**/wp-translation-downloader.lock | |
# figuren-theater/ft-theming/wp-better-emails --> Error: Error: Server sent FIN packet unexpectedly ... | |
**/wp-better-emails/preview.html | |
# figuren-theater/ft-data/distributor --> Error: Error: Server sent FIN packet unexpectedly ... | |
**/distributor/lang/distributor.pot | |
# figuren-theater/ft-privacy/koko-analytics --> Error: Error: Server sent FIN packet unexpectedly ... | |
# An empty file by (security) design | |
**/koko-analytics/assets/dist/js/koko-analytics-script-test.js | |
# figuren-theater/ft-theater/gatherpress --> Error: Error: Server sent FIN packet unexpectedly ... | |
# EMPTY FILE | |
**/gatherpress/build/admin_style.js |