-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (58 loc) · 1.9 KB
/
bundle.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
65
66
67
68
69
70
name: Bundle release
on:
release:
types: [ published ]
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
bundle:
name: Add zip to release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name }}
- uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '-oa --no-dev'
- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install node packages
run: npm install
- name: Bundle assets
run: npm run build --no-dev --no-progress
- name: Move bundled files to a subfolder and zip
run: |
chmod +x "$GITHUB_WORKSPACE/bin/bundle-plugin.sh"
bash "$GITHUB_WORKSPACE/bin/bundle-plugin.sh" "$GITHUB_WORKSPACE"
shell: bash
- name: Zip Folder
run: zip -r release.zip eightshift-forms
- name: Upload zip to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'release.zip'
tag: ${{ github.ref }}
overwrite: true