ISA-609: Fix coding error breaking MapServer single layer legends #800
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: Build frontend | |
on: | |
push: | |
branches: | |
- develop | |
- master | |
workflow_dispatch: | |
jobs: | |
create-release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
# Introduces slugified variables; eg "master" instead of "refs/heads/master" | |
- name: Inject slug/short variables | |
uses: rlespinasse/[email protected] | |
- 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 | |
frontend-build: | |
name: Build Frontend | |
needs: create-release | |
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, '/master') }} | |
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 frontend.tgz . | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
asset_path: "frontend/frontend.tgz" | |
asset_name: frontend.tgz | |
asset_content_type: application/gzip | |
build-carbon-abatement-sidebar: | |
name: Build Carbon Abatement Sidebar | |
needs: create-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'yarn' | |
cache-dependency-path: 'backend/carbonabatementsidebar/frontend/yarn.lock' | |
- name: Install Dependencies and Build | |
working-directory: 'backend/carbonabatementsidebar/frontend' | |
run: | | |
yarn install | |
yarn build | |
- name: Ensure static archive is group-writeable for safe extraction | |
run: chmod -R g+w backend/carbonabatementsidebar/static | |
- name: Zip Static Files | |
run: tar -czv -C backend/carbonabatementsidebar/static -f backend/carbonabatementsidebar/static.tgz . | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
asset_path: backend/carbonabatementsidebar/static.tgz | |
asset_name: carbonabatementsidebar-static.tgz | |
asset_content_type: application/gzip |