Bundle release #222
Workflow file for this run
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
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 |