Skip to content

Commit

Permalink
Merge pull request #1393 from ArmDeveloperEcosystem/main
Browse files Browse the repository at this point in the history
Prod update
  • Loading branch information
pareenaverma authored Nov 13, 2024
2 parents 02ab160 + 9920c9c commit 4a4e66d
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 99 deletions.
85 changes: 41 additions & 44 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,66 @@
# This is a basic workflow to help you get started with Actions
name: Deploy Hugo to S3

name: 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:
workflow_call:
inputs:
target:
description: "Hugo target to deploy to"
required: true
type: string
aws-region:
description: "AWS Region to use for fetching credentials"
required: false
type: string
default: "us-west-2"
secrets:
AWS_OIDC_ROLE:
required: true
HUGO_LLM_API:
required: true

env:
HUGO_VERSION: 0.130.0

# 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
permissions:
id-token: write
contents: read
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo Themes
fetch-depth: 0
submodules: true # Fetch Hugo Themes
fetch-depth: 0

# Sets Up Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.130.0'
extended: true
# Post-CSS install
hugo-version: ${{ env.HUGO_VERSION }}
extended: true

# Installs Post-CSS
- name: Install Post-CSS
run: npm install postcss-cli

# Builds arm-learning-paths repo
- name: AWS Github OIDC Login
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
aws-region: ${{ inputs.aws-region }}

# Builds arm-software-developer repo
- name: Build
run: |
hugo --minify
cp learn-image-sitemap.xml public/learn-image-sitemap.xml
bin/pagefind --site "public"
env:
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}

# 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 public.zip .
cd ..
scp -i key -o StrictHostKeyChecking=accept-new -oHostKeyAlgorithms=+ssh-dss -r public/public.zip $USR@$HOST:/$ID/
shell: bash
env:
USR: ${{secrets.SSH_USERNAME}}
HOST: ${{secrets.SSH_HOST}}
ID: ${{secrets.ID}}

# Deploys website to AWS S3 and invalidate CloudFront Cache
- name: Deploy to S3
run: hugo deploy --force --maxDeletes -1 --invalidateCDN --target ${{ inputs.target }}
51 changes: 29 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,63 @@
# This is a basic workflow to help you get started with Actions
# This workflow will be triggered on a push to the 'main' branch automatically or when called manually.
# Upon running this workflow, the website will be built and deployed to the internal instance.
name: Build and Deploy Internal Website

name: build-and-deploy

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
# Runs on pushes to the 'main' branch
push:
branches: [ main ]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
# Allows 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_s3:
build_and_deploy_internal_existing:
name: Build and Deploy Internal Existing
# 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@v4
with:
submodules: true # Fetch Hugo Themes
fetch-depth: 0
submodules: true # Fetch Hugo Themes
fetch-depth: 0

# Sets Up Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.130.0'
extended: true
hugo-version: "0.130.0"
extended: true

# Post-CSS install and Node.js
- name: Install Post-CSS
run: npm install postcss-cli


# Builds arm-software-developer repo
- name: Build
run: |
hugo --minify
cp learn-image-sitemap.xml public/learn-image-sitemap.xml
bin/pagefind --site "public"
env:
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}

# Deploys website to AWS S3
- name: Deploy to S3
run: hugo deploy --force --maxDeletes -1 --invalidateCDN
run: hugo deploy --force --maxDeletes -1 --invalidateCDN --target internal-existing
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

build_and_deploy_internal:
name: Build and Deploy Internal
uses: ./.github/workflows/deploy.yml
permissions:
id-token: write
contents: read
with:
target: internal
secrets:
AWS_OIDC_ROLE: ${{ secrets.AWS_OIDC_ROLE_INTERNAL }}
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
79 changes: 79 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow will be triggered on a push to the 'production' branch automatically or when called manually.
# Upon running this workflow, the website will be built and deployed to the production instance.
name: Build and Deploy Production Website

on:
# Runs on pushes to the 'production' branch
push:
branches: [production]

# Allows to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build_and_deploy_existing:
# 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@v4
with:
submodules: true # Fetch Hugo Themes
fetch-depth: 0

# Sets Up Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.130.0"
extended: true

# Post-CSS install
- name: Install Post-CSS
run: npm install postcss-cli

# Builds arm-learning-paths repo
- name: Build
run: |
hugo --minify
cp learn-image-sitemap.xml public/learn-image-sitemap.xml
bin/pagefind --site "public"
env:
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}

# 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 public.zip .
cd ..
scp -i key -o StrictHostKeyChecking=accept-new -oHostKeyAlgorithms=+ssh-dss -r public/public.zip $USR@$HOST:/$ID/
shell: bash
env:
USR: ${{secrets.SSH_USERNAME}}
HOST: ${{secrets.SSH_HOST}}
ID: ${{secrets.ID}}

build_and_deploy_production:
name: Build and Deploy Production
uses: ./.github/workflows/deploy.yml
permissions:
id-token: write
contents: read
with:
target: production
secrets:
AWS_OIDC_ROLE: ${{ secrets.AWS_OIDC_ROLE_PRODUCTION }}
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
69 changes: 37 additions & 32 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,54 @@ enableRobotsTXT = true

[deployment]
[[deployment.targets]]
name = "aws"
name = "internal-existing"
URL = "s3://armswdev.tk?region=us-east-1"
cloudFrontDistributionID = "E2VDQ2CYZATMO9"

[[deployment.targets]]
name = "internal"
URL = "s3://arm-learning-paths-internal?region=us-west-2"
cloudFrontDistributionID = "ENN4LK1IZUDIX"


[[deployment.targets]]
name = "production"
URL = "s3://arm-learning-paths?region=us-west-2"
cloudFrontDistributionID = "E2NEF61QWPFRIH"

[frontmatter]
lastmod = [ "lastmod", ":git", "date", "publishDate" ]
lastmod = ["lastmod", ":git", "date", "publishDate"]

[taxonomies]
subject = "subjects"
operatingsystem = "operatingsystems"
skilllevel = "skilllevels"
tool_software_language = "tools_software_languages"
armip = "armips"
cloud_service_provider = "cloud_service_providers"

subject = "subjects"
operatingsystem = "operatingsystems"
skilllevel = "skilllevels"
tool_software_language = "tools_software_languages"
armip = "armips"
cloud_service_provider = "cloud_service_providers"

[permalinks]
tools_software_languages = "/tag/:slug/"
operatingsystems = "/tag/:slug/"
subjects = "/tag/:slug/"
cloud_service_providers = "/tag/:slug/"
armips = "/tag/:slug/"
tools_software_languages = "/tag/:slug/"
operatingsystems = "/tag/:slug/"
subjects = "/tag/:slug/"
cloud_service_providers = "/tag/:slug/"
armips = "/tag/:slug/"

[related]
threshold = 0
includeNewer = true
toLower = false

[[related.indices]]
name = "cloud_service_providers"
weight = 100

[[related.indices]]
name = "tools_software_languages"
weight = 80
[[related.indices]]
name = "subjects"
weight = 50
threshold = 0
includeNewer = true
toLower = false

[[related.indices]]
name = "cloud_service_providers"
weight = 100

[[related.indices]]
name = "tools_software_languages"
weight = 80

[[related.indices]]
name = "subjects"
weight = 50

[params]
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
Expand All @@ -60,13 +66,12 @@ github_project_repo = "https://github.com/ArmDeveloperEcosystem/arm-learning-pat
# location of assets
assetsDir = "assets"


# Specify a value here if your content directory is not in your repo's root directory
# github_subdir = ""

# Uncomment this if your GitHub repo does not have "main" as the default branch,
# or specify a new value if you want to reference another branch in your GitHub links
github_branch= "main"
github_branch = "main"

# For metadata posting on socials
title = 'Arm Learning Paths'
Expand Down
8 changes: 8 additions & 0 deletions content/error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Request Error"
description = "We are unable to serve this request at the moment."
+++

# Request cannot be served

We are unable to serve this request at the moment. Try going back to our [home page](/).
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ layout: "learningpathall"

The Thelio Astra makes it possible to build the complete software stack on an Arm-based local machine instead of using a non-Arm desktop computer, with the ISA compatibility benefits that it brings to Arm-based software development. Using Arm-based cloud instances is another option.

You can build the Using the Arm Automotive Solutions Software Reference Stack from the command line of the Ubuntu 20.04 Multipass virtual machine.
You can build the Arm Automotive Solutions Software Reference Stack from the command line of the Ubuntu 20.04 Multipass virtual machine.

Start by creating a new directory, and then clone the repository:

Expand Down
Loading

0 comments on commit 4a4e66d

Please sign in to comment.