Skip to content

Update build&deploy.yml #50

Update build&deploy.yml

Update build&deploy.yml #50

Workflow file for this run

flpersname: Juno (build & deploy)

Check failure on line 1 in .github/workflows/build&deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build&deploy.yml

Invalid workflow file

The workflow is not valid. .github/workflows/build&deploy.yml (Line: 1, Col: 1): Unexpected value 'flpersname' .github/workflows/build&deploy.yml (Line: 37, Col: 28): Unexpected symbol: '"app"'. Located at position 19 within expression: env.ASSET_TYPE == "app" && "libs" || ""
on:
push:
branches:
- gh-ci
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# On release creation
# release:
# types: [created]
env:
ASSET_NAME: exampleapp
ASSET_TYPE: app
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "build-and-publish-asset"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
build-and-deploy:
runs-on: [ubuntu-latest]
env:
ACTIONS_RUNNER_DEBUG: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: |
${{ env.ASSET_TYPE == "app" && "libs" || "" }}
apps
scripts
helpers
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: https://npm.pkg.github.com/
scope: "@${{ github.repository_owner }}"
- name: build libs
run: |
ls -la
# install npm packages
npm install
# build libs if asset type is "app"
if [ "$ASSET_TYPE" = "app" ] || [ "$ASSET_TYPE" = "apps" ]; then npm run build-libs; fi
- name: build asset
run: |
# replace
jq '.name = "@${{ github.repository_owner }}/exampleapp" | .private = false' \
./apps/exampleapp/package.json > "/tmp/test.json" && \
mv /tmp/test.json ./apps/exampleapp/package.json
npm -w @${{ github.repository_owner }}/exampleapp run build
- name: Publish to github packages
run: |
# copy generated .npmrc to repository
cp $NPM_CONFIG_USERCONFIG ./
# publish to https://github.com/${{ github.repository_owner }}/packages
npm -w @${{ github.repository_owner }}/exampleapp publish #--dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}