diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8418df0f61..f417e0a941 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,11 +41,11 @@ jobs: # Builds arm-software-developer repo - name: Build - run: hugo --minify + run: hugo --minify --config config.toml,config.cloudfront.toml # Deploys website to AWS S3 - name: Deploy to S3 - run: hugo deploy --force --maxDeletes -1 --invalidateCDN + run: hugo deploy --force --maxDeletes -1 --invalidateCDN --config config.toml,config.cloudfront.toml env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/staging-content-deploy.yml b/.github/workflows/staging-content-deploy.yml new file mode 100644 index 0000000000..d0ddb05c5a --- /dev/null +++ b/.github/workflows/staging-content-deploy.yml @@ -0,0 +1,67 @@ +# This is a basic workflow to help you get started with Actions + +name: staging-content-deploy + +# Controls when the workflow will run +on: + # Triggers the workflow on push to production branch + push: + branches: [ production ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build_and_deploy: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + submodules: true # Fetch Hugo Themes + fetch-depth: 0 + + # Sets Up Hugo + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.98.0' + extended: true + + # Post-CSS install + - name: Install Post-CSS + run: npm install postcss-cli + + # Builds ecosystem-dashboard-for-arm repo + - name: Build + run: | + export HUGO_PRODUCTION=true + hugo --minify + + + # Copy SSH Key + - name: copy key + run: | + echo $SSH_KEY | xargs -n 1 > tmpkey + base64 -d < tmpkey > key + chmod 400 key + shell: bash + env: + SSH_KEY: ${{secrets.SSH_KEY}} + + # SCP Site contents to netstorage + - name: copy site content + run: | + cd public + zip -r dev-public.zip . + cd .. + scp -i key -o StrictHostKeyChecking=accept-new -oHostKeyAlgorithms=+ssh-dss -r public/dev-public.zip $USR@$HOST:/$ID/ + shell: bash + env: + USR: ${{secrets.SSH_USERNAME}} + HOST: ${{secrets.SSH_HOST}} + ID: ${{secrets.ID}} diff --git a/config.cloudfront.toml b/config.cloudfront.toml new file mode 100644 index 0000000000..68c3bafe26 --- /dev/null +++ b/config.cloudfront.toml @@ -0,0 +1,4 @@ +baseURL = "https://d1jmgdpytvgwdc.cloudfront.net/" + +[params] +dashboard_base_path = "" diff --git a/config.toml b/config.toml index 308ac81ba4..28ddfd5a75 100644 --- a/config.toml +++ b/config.toml @@ -24,6 +24,7 @@ cloudFrontDistributionID = "EBSHXJ6P4DYP8" [params] # location of assets assetsDir = "assets" +dashboard_base_path = "/ecosystem-dashboard" # Repository configuration (URLs for in-page links to opening issues and suggesting changes) github_repo = "https://github.com/ArmDeveloperEcosystem/ecosystem-dashboard-for-arm" @@ -33,4 +34,4 @@ arm_url = "https://developer.arm.com/ecosystem-dashboard/" title = 'Software Ecosystem Dashboard for Arm' description = 'Discover what software packages work on Arm servers and how to get started. A great resource for migrating to Arm.' social_image = '/ecosystem-dashboard/img/social-image.jpg' -twitter_handle = '@ArmSoftwareDev' \ No newline at end of file +twitter_handle = '@ArmSoftwareDev' diff --git a/content/linux/_index.md b/content/linux/_index.md index 4754d2f30c..ac16b39118 100644 --- a/content/linux/_index.md +++ b/content/linux/_index.md @@ -3,5 +3,5 @@ title: Cloud Software Ecosystem Dashboard for Arm os: Linux backgroundColor: 3c5610 # green textColor: 95D629 # DBFF89 # green -logo: /img/LinuxLogo.svg +logo: img/LinuxLogo.svg --- \ No newline at end of file diff --git a/content/windows/_index.md b/content/windows/_index.md index 55b6926fac..b81a151526 100644 --- a/content/windows/_index.md +++ b/content/windows/_index.md @@ -3,5 +3,5 @@ title: Windows on Arm Software Dashboard os: Windows backgroundColor: 002B49 # blue textColor: 92D2FF # light blue -logo: /img/WindowsLogo.svg +logo: img/WindowsLogo.svg --- \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/layouts/index.html b/themes/arm-design-system-hugo-theme/layouts/index.html index 433a05e2be..bdc82d4504 100644 --- a/themes/arm-design-system-hugo-theme/layouts/index.html +++ b/themes/arm-design-system-hugo-theme/layouts/index.html @@ -14,7 +14,7 @@
diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/eco-dashboard/info-top.html b/themes/arm-design-system-hugo-theme/layouts/partials/eco-dashboard/info-top.html index 339cb60f8d..274f16ae4a 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/eco-dashboard/info-top.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/eco-dashboard/info-top.html @@ -24,10 +24,28 @@
- OS Logo + {{- $logo_src := .Params.logo | absURL -}} + {{- if eq .Site.BaseURL "/" -}} + {{- $base_path := (.Site.Params.dashboard_base_path | default "/ecosystem-dashboard") | strings.TrimRight "/" -}} + {{- if eq $base_path "" -}} + {{- $logo_src = printf "/%s" .Params.logo -}} + {{- else -}} + {{- $logo_src = printf "%s/%s" $base_path .Params.logo -}} + {{- end -}} + {{- end -}} + OS Logo
- OS Logo + {{- $logo_src := .Params.logo | absURL -}} + {{- if eq .Site.BaseURL "/" -}} + {{- $base_path := (.Site.Params.dashboard_base_path | default "/ecosystem-dashboard") | strings.TrimRight "/" -}} + {{- if eq $base_path "" -}} + {{- $logo_src = printf "/%s" .Params.logo -}} + {{- else -}} + {{- $logo_src = printf "%s/%s" $base_path .Params.logo -}} + {{- end -}} + {{- end -}} + OS Logo
@@ -39,9 +57,25 @@ // Add event listener on click of switch-dashboards ads-cta button to navigate to appropriate dashboard document.getElementById('switch-dashboards').addEventListener('click', function() { {{if eq .Params.os "Linux"}} - window.location.href = '{{ "/windows/" | relURL }}'; + {{- $base := .Site.BaseURL | strings.TrimRight "/" -}} + {{- if eq $base "" -}} + {{- $base = (.Site.Params.dashboard_base_path | default "/ecosystem-dashboard") | strings.TrimRight "/" -}} + {{- end -}} + {{- if eq $base "" -}} + window.location.href = '/windows'; + {{- else -}} + window.location.href = '{{ printf "%s/windows" $base }}'; + {{- end -}} {{else if eq .Params.os "Windows"}} - window.location.href = '{{ "/linux/" | relURL }}'; + {{- $base := .Site.BaseURL | strings.TrimRight "/" -}} + {{- if eq $base "" -}} + {{- $base = (.Site.Params.dashboard_base_path | default "/ecosystem-dashboard") | strings.TrimRight "/" -}} + {{- end -}} + {{- if eq $base "" -}} + window.location.href = '/linux'; + {{- else -}} + window.location.href = '{{ printf "%s/linux" $base }}'; + {{- end -}} {{else}} {{end}} @@ -51,4 +85,4 @@ window.open('{{printf "%s/%s" site.Params.github_repo "#readme"}}', '_blank'); }); - \ No newline at end of file + diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html index eb8c1e7938..7fc9811221 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/footer/script-includes.html @@ -1,8 +1,20 @@ - - - - +{{- $js_search := "js/eco-dashboard/search.js" -}} +{{- $js_table := "js/eco-dashboard/table_functionality.js" -}} +{{- $js_mobile := "js/eco-dashboard/filter-and-navigate-mobile-behavior.js" -}} +{{- $js_analytics := "js/anonymous-analytics.js" -}} + +{{- if eq (getenv "HUGO_PRODUCTION") "true" -}} + + + + +{{- else -}} + + + + +{{- end -}} diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html b/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html index efecaf71ee..c1f06789f5 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html @@ -13,9 +13,18 @@ {{ $css_file_location := $css_home.Permalink}} -{{/* ONLY INCLUDE THIS BASE URL IF PUSHING TO PRODUCTION SERVER. OTHERWISE, IGNORE */}} -{{- if eq (getenv "HUGO_PRODUCTION") "true" -}} - +{{/* ONLY INCLUDE THIS BASE URL IF PUSHING TO PRODUCTION SERVER OR BASEURL POINTS TO ECOSYSTEM-DASHBOARD */}} +{{- if or (eq (getenv "HUGO_PRODUCTION") "true") (in .Site.BaseURL "developer.arm.com/ecosystem-dashboard") -}} + {{- $base_href := .Site.BaseURL -}} + {{- $base_path := (.Site.Params.dashboard_base_path | default "/ecosystem-dashboard") | strings.TrimRight "/" -}} + {{- if eq $base_href "/" -}} + {{- if eq $base_path "" -}} + {{- $base_href = "/" -}} + {{- else -}} + {{- $base_href = printf "%s/" $base_path -}} + {{- end -}} + {{- end -}} + {{/* CSS file update to without leading slash */}} {{ $css_file_location = trim $css_home.Permalink "/"}} diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/main-page/main.html b/themes/arm-design-system-hugo-theme/layouts/partials/main-page/main.html index e239bf8572..1237a147fc 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/main-page/main.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/main-page/main.html @@ -12,7 +12,12 @@ {{ $filter_licenses := slice "All" "Open source" "Commercial" }} -{{ $filter_categories := (slice "All") | append .context.Site.Data.category_data.groups}} +{{ $filter_categories_all := (slice "All") | append .context.Site.Data.category_data.groups}} +{{ $filter_categories := $filter_categories_all }} +{{ if eq .OS "Windows" }} + {{/* Only show Windows categories that have packages */}} + {{ $filter_categories = slice "All" "AI/ML" "Cloud-native" "Database" "Languages" "Media" "Networking" "Security" "Web" "Miscellaneous" }} +{{ end }} {{/******************************************************* *******************************************************/}} @@ -117,5 +122,3 @@

Most recently added packa {{ partial "eco-dashboard/scripts-for-three-ctas.html"}} */}} - -