-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 3.5 KB
/
deploy-vendors.yml
File metadata and controls
83 lines (71 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Deploy Vendor Folders
on:
workflow_run:
workflows:
- "Publish Website"
branches:
- trunk
- staging
types:
- completed
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run — runs composer install but skips all uploads'
type: boolean
default: false
jobs:
deploy-vendors:
name: Build and Deploy Vendor Folders
runs-on: ubuntu-latest
# For workflow_run events, only proceed if the upstream workflow succeeded.
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
# workflow_run executes in the context of the default branch, so use
# head_branch from the event payload to select the right environment.
environment: ${{ (github.event.workflow_run.head_branch || github.ref_name) == 'trunk' && 'production' || 'staging' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer
# ── Plugin ─────────────────────────────────────────────────────────────
- name: Install plugin dependencies (bifrost-framework)
working-directory: plugins/bifrost-framework
run: composer install --no-dev --optimize-autoloader --no-interaction
- name: Upload plugin vendor folder
if: ${{ inputs.dry_run != true && hashFiles('plugins/bifrost-framework/vendor/**') != '' }}
uses: Automattic/FTP-Deploy-Action@3.1.2
with:
ftp-server: sftp://sftp.wp.com/htdocs/wp-content/plugins/bifrost-framework/vendor/
ftp-username: ${{ secrets.SFTP_USER }}
ftp-password: ${{ secrets.SFTP_PASSWORD }}
local-dir: plugins/bifrost-framework/vendor/
known-hosts: ${{ secrets.SFTP_KNOWN_HOSTS }}
- name: Install plugin dependencies (bifrost-music)
working-directory: plugins/bifrost-music
run: composer install --no-dev --optimize-autoloader --no-interaction
- name: Upload plugin vendor folder
if: ${{ inputs.dry_run != true && hashFiles('plugins/bifrost-music/vendor/**') != '' }}
uses: Automattic/FTP-Deploy-Action@3.1.2
with:
ftp-server: sftp://sftp.wp.com/htdocs/wp-content/plugins/bifrost-music/vendor/
ftp-username: ${{ secrets.SFTP_USER }}
ftp-password: ${{ secrets.SFTP_PASSWORD }}
local-dir: plugins/bifrost-music/vendor/
known-hosts: ${{ secrets.SFTP_KNOWN_HOSTS }}
# ── Theme ───────────────────────────────────────────────────────────────
- name: Install theme dependencies (bifrost-noise)
working-directory: themes/bifrost-noise
run: composer install --no-dev --optimize-autoloader --no-interaction
- name: Upload theme vendor folder
if: ${{ inputs.dry_run != true && hashFiles('themes/bifrost-noise/vendor/**') != '' }}
uses: Automattic/FTP-Deploy-Action@3.1.2
with:
ftp-server: sftp://sftp.wp.com/htdocs/wp-content/themes/bifrost-noise/vendor/
ftp-username: ${{ secrets.SFTP_USER }}
ftp-password: ${{ secrets.SFTP_PASSWORD }}
local-dir: themes/bifrost-noise/vendor/
known-hosts: ${{ secrets.SFTP_KNOWN_HOSTS }}