-
Notifications
You must be signed in to change notification settings - Fork 223
64 lines (54 loc) · 2 KB
/
deploy_plugin.yml
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
on:
release:
types:
- published
name: Deploy Rocket Plugin
jobs:
deploy:
name: Deploy Rocket Plugin
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v2
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Download zip
run: |
wget -O base.zip "https://github.com/wp-media/wp-rocket/archive/${{ github.event.release.target_commitish }}.zip"
unzip base.zip
mv wp-rocket-* wp-rocket
working-directory: /tmp
- name: Remove unmet dependencies by legacy versions
run: composer remove --dev --update-no-dev --no-scripts coenjacobs/mozart
working-directory: /tmp/wp-rocket
- name: Run composer
run: composer install --no-scripts --no-dev
working-directory: /tmp/wp-rocket
- name: Remove composer installers
run: composer remove composer/installers --update-no-dev --no-scripts
working-directory: /tmp/wp-rocket
- name: Optimize autoloader
run: composer dumpautoload -o
working-directory: /tmp/wp-rocket
- name: Zip Folder
run: zip -r __wp-rocket_${GITHUB_REF##*v}.zip wp-rocket
working-directory: /tmp
- name: Upload Zip
run: |
curl -v -X POST \
-H "Content-Type: multipart/form-data" \
-F "file=@/tmp/__wp-rocket_${GITHUB_REF##*v}.zip;type=application/zip" \
-H "Authorization: Bearer ${{ secrets.UPLOAD_ZIP_TOKEN }}" \
${{ secrets.UPLOAD_ZIP_URL }}