Skip to content

(ISA-495) Fixing patterend layer preview generation hatch order #668

(ISA-495) Fixing patterend layer preview generation hatch order

(ISA-495) Fixing patterend layer preview generation hatch order #668

Workflow file for this run

name: Build frontend
on:
push:
branches:
- develop
- master
workflow_dispatch:
jobs:
frontend-build:
name: Build Front-end
runs-on: ubuntu-latest
env:
LEIN_ROOT: nbd
JVM_OPTS: -Xmx3200m
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v2
# Introduces slugified variables; eg "master" instead of "refs/heads/master"
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Conditionally set build profile based on branch (master)
if: endswith(github.ref, '/master')
run: |
echo "PROFILE=min" >> $GITHUB_ENV
- name: Conditionally set build profile based on branch (develop)
if: endswith(github.ref, '/develop')
run: |
echo "PROFILE=mindev" >> $GITHUB_ENV
- name: Set up Java for Clojure
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set up / restore caching
uses: actions/cache@v2
with:
path: node_modules
key: npm-packages-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-packages-
- name: Cache maven deps as well
uses: actions/cache@v2
with:
path: ~/.m2
key: m2-deps-${{ hashFiles('shadow-cljs.edn') }}
restore-keys: |
m2-deps-
- name: Install Dependencies
run: yarn
- name: Build Blueprint CSS
run: yarn build-blueprint-css
- name: Style build
run: yarn build-css
- name: Components build
run: yarn build-js
- name: Worker build
run: yarn build-worker
- name: Build project
run: npx shadow-cljs release ${{ env.PROFILE }}
- name: Expand cache-busting app.js tag
run: |
app_tag=$(jq '.[0]."output-name"' 'resources/public/js/manifest.json')
app_tag=$(echo $app_tag | sed 's/^"//;s/"$//')
sed -i "s/app.js/$app_tag/" 'resources/public/index.html'
- name: Ensure archive is group-writeable for safe extraction
run: chmod -R g+w resources/public
- run: tar -c -z -v -C resources/public -f "${{ env.GITHUB_REPOSITORY_SLUG }}-${{ env.GITHUB_REF_SLUG }}-frontend.tgz" .
- name: Create timestamp for release tag-name
id: tag_name
run: echo "tag_name=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
- name: Cut a release, for download by Ansible
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_name.outputs.tag_name }}
release_name: Frontend (${{ env.GITHUB_REF_SLUG }} - ${{ env.GITHUB_SHA_SHORT }})
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "frontend/${{ env.GITHUB_REPOSITORY_SLUG }}-${{ env.GITHUB_REF_SLUG }}-frontend.tgz"
asset_name: "${{ env.GITHUB_REPOSITORY_SLUG }}-${{ env.GITHUB_REF_SLUG }}-frontend.tgz"
asset_content_type: application/gzip