Skip to content

Commit

Permalink
demo page: disable build optimization (#68)
Browse files Browse the repository at this point in the history
* demo page: disable build optimization

* doc fix helper description

* update cdn demo versioning

* remove cdn deploy path filter

* update dest demo page

* Update azure-cdn-deploy.yml

---------

Co-authored-by: medevod <medevod@github.com>
  • Loading branch information
medevod and medevod authored Nov 1, 2024
1 parent 45238ff commit a8088a6
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 14 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/azure-cdn-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mgplus workflow

name: Azure CDN CI/CD
name: Azure CDN and Demo CI/CD
env:
AZURE_STORAGE_SERVICE_ENDPOINT: https://stevodocs.blob.core.windows.net/
AZURE_STORAGE_AUTH_MODE: login
Expand All @@ -14,7 +14,6 @@ on:
types: [opened, synchronize, reopened, closed]
branches:
- master
paths: ["dist/**"]
jobs:
# deploy pullrequest version of demo site
deploy_pullrequest:
Expand Down Expand Up @@ -67,7 +66,7 @@ jobs:
az storage blob upload-batch -s $DEMO_SOURCE_DIR -d $DEMO_DEST_DIR --account-name $ACCOUNT_NAME
az storage blob upload-batch -s $DIST_SOURCE_DIR -d $DIST_DEST_DIR --account-name $ACCOUNT_NAME
deploy_preview:
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/master') == true
runs-on: ubuntu-latest
name: CDN - build and deploy preview version
permissions:
Expand Down Expand Up @@ -106,6 +105,53 @@ jobs:
DEMO_SOURCE_DIR: demo_build
DEMO_DEST_DIR: "$web/mgplus/preview"
DIST_SOURCE_DIR: dist
DIST_DEST_DIR: "mgpluscdn/v${{ steps.package-version.outputs.current-version}}-preview"
with:
azcliversion: 2.30.0
inlineScript: |
az extension add -n storage-preview -y
az storage blob upload-batch -s $DEMO_SOURCE_DIR -d $DEMO_DEST_DIR --account-name $ACCOUNT_NAME
az storage blob upload-batch -s $DIST_SOURCE_DIR -d $DIST_DEST_DIR --account-name $ACCOUNT_NAME
deploy_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') == true
runs-on: ubuntu-latest
name: CDN - build and deploy release version
permissions:
contents: read
id-token: write
steps:
- name: "Checkout Github Action"
uses: actions/checkout@master
- name: Setup Node 18.x
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: "build minified main css library, js plugins and demo in standalone mode"
env:
PACKAGE_VERSION: "v${{ steps.package-version.outputs.current-version}}"
run: |
npm install
npm run lint
npm run build
npm run build:demo
npm run test --if-present
- name: azure login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true
- name: deploy demo site to Azure static website
uses: azure/CLI@v1
env:
ACCOUNT_NAME: stevodocs
DEMO_SOURCE_DIR: demo_build
DEMO_DEST_DIR: "$web/mgplus/release"
DIST_SOURCE_DIR: dist
DIST_DEST_DIR: "mgpluscdn/v${{ steps.package-version.outputs.current-version}}"
with:
azcliversion: 2.30.0
Expand Down
5 changes: 3 additions & 2 deletions .htmlnanorc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"mergeScripts": false,
"mergeStyles": false,
"removeUnusedCss": false,
"minifyJson": true,
"minifySvg": true,
"minifyJson": false,
"minifySvg": false,
"minifyUrls": false,
"removeEmptyAttributes": false,
"removeRedundantAttributes": false,
"removeComments": true
Expand Down
4 changes: 2 additions & 2 deletions .parcelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"@parcel/transformer-css"
],
"*.html": [
"...",
"@plasmohq/parcel-transformer-inject-env"
"@plasmohq/parcel-transformer-inject-env",
"..."
]
}
}
12 changes: 6 additions & 6 deletions demo/sections/helpers-section.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ <h4>Padding</h4>
</div>
<h4>Marging</h4>
<div class="mg-col">
<span><code>.mg-marg</code>[0-10] { margin: [0-10]rem; }</span>
<span><code>.mg-marg-l</code>[0-10] { margin-left: [0-10]rem; }</span>
<span><code>.mg-marg-r</code>[0-10] { margin-right: [0-10]rem; }</span>
<span><code>.mg-marg-b</code>[0-10] { margin-bottom: [0-10]rem; }</span>
<span><code>.mg-marg-t</code>[0-10] { margin-top: [0-10]rem; }</span>
<span><code>.mg-marg-auto</code> { margin: auto; }</span>
<span><code>.mg-mrg</code>[0-10] { margin: [0-10]rem; }</span>
<span><code>.mg-mrg-l</code>[0-10] { margin-left: [0-10]rem; }</span>
<span><code>.mg-mrg-r</code>[0-10] { margin-right: [0-10]rem; }</span>
<span><code>.mg-mrg-b</code>[0-10] { margin-bottom: [0-10]rem; }</span>
<span><code>.mg-mrg-t</code>[0-10] { margin-top: [0-10]rem; }</span>
<span><code>.mg-mrg-auto</code> { margin: auto; }</span>
</div>
<h4>Placing</h4>
<div class="mg-col">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"start": "parcel serve --dist-dir demo_temp --open",
"build": "parcel build --no-source-maps --target library --target plugins ",
"build:debug": "parcel build --target library --target plugins --no-optimize",
"build:demo": "parcel build --no-source-maps --target demo"
"build:demo": "parcel build --no-source-maps --target demo --no-optimize"
},
"dependencies": {
"stylelint-config-standard-scss": "^13.1.0"
Expand Down

0 comments on commit a8088a6

Please sign in to comment.