Skip to content

Commit

Permalink
♻️ Redesign SSW Dory landing page & rearchitect to use NextJS and hos…
Browse files Browse the repository at this point in the history
…ted in Azure Storage (#70)

<!-- describe the change, why is it needed and what does it accomplish
as per https://ssw.com.au/rules/write-a-good-pull-request/ -->
The current tech stack using Jekyll is too restrictive in terms of
website design. Moving it over to NextJS and emulating the website
design of Code Auditor

![image](https://github.com/SSWConsulting/SSW.Dory/assets/41951199/5331ec13-3217-4ab2-b42b-0f7bd4951cd3)
Figure: Code Auditor front page

<!-- Add done video, screenshots as per
https://ssw.com.au/rules/record-a-quick-and-dirty-done-video/-->

![image](https://github.com/SSWConsulting/SSW.Dory/assets/41951199/c0214b10-6dd5-4b00-8e77-1adcc45de7d7)
Figure: redesigned SSW Dory landing page

<!-- As per rule https://www.ssw.com.au/rules/over-the-shoulder-prs -->
<!-- Getting the PR merged is part of the task - Call someone to review
your changes to get them merged ASAP -->
  • Loading branch information
leahy268 authored Oct 4, 2023
2 parents 9f8b9b8 + 7cb601a commit 265dcc5
Show file tree
Hide file tree
Showing 47 changed files with 810 additions and 594 deletions.
Binary file removed .DS_Store
Binary file not shown.
36 changes: 36 additions & 0 deletions .github/workflows/build-static-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Next.js static site

on: workflow_call

# Sets permissions of the GITHUB_TOKEN
permissions:
contents: read
checks: write
id-token: write

# Set working directory
defaults:
run:
working-directory: ./docs

jobs:
build-site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Build with Next.js
run: bun run build

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: out
path: ./docs/out
34 changes: 34 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CICD Pipeline

on:
push:
branches: ["main"]
paths-ignore:
- .gitignore

workflow_dispatch:

jobs:
# deploy-dev:
# uses: .github/workflows/deploy.yml
# with:
# environment: dev
# secrets: inherit

deploy-prod:
uses: ./.github/workflows/deploy.yml
with:
environment: prod
secrets: inherit

build-site:
uses: ./.github/workflows/build-static-site.yml
secrets: inherit

deploy-site-prod:
uses: ./.github/workflows/deploy-static-site.yml
with:
environment: prod
secrets: inherit
needs: build-site

47 changes: 47 additions & 0 deletions .github/workflows/deploy-static-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Next.js static site

on:
workflow_call:
inputs:
environment:
description: "Name of the environment to deploy to"
required: true
type: string

# Sets permissions of the GITHUB_TOKEN
permissions:
id-token: write
contents: read
checks: write

jobs:
deploy-site:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}

env:
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP}}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
TENANT_ID: ${{ secrets.TENANT_ID }}
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}

steps:
- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ env.CLIENT_ID }}
tenant-id: ${{ env.TENANT_ID }}
subscription-id: ${{ env.SUBSCRIPTION_ID }}

- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
name: out

- name: Clean out old assets in Azure
run: |
az storage blob delete-batch --account-name sswdory -s '$web'
- name: Upload new assets to Azure
run: |
az storage blob upload-batch --overwrite true --account-name sswdory -d '$web' -s .
68 changes: 68 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: deploy

on:
workflow_call:
inputs:
environment:
description: "Name of the environment to deploy to"
required: true
type: string

permissions:
id-token: write
contents: read
checks: write

defaults:
run:
shell: pwsh

jobs:
deploy-bicep:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}

env:
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP}}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
TENANT_ID: ${{ secrets.TENANT_ID }}
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ env.CLIENT_ID }}
tenant-id: ${{ env.TENANT_ID }}
subscription-id: ${{ env.SUBSCRIPTION_ID }}

- name: Validate Bicep
uses: azure/arm-deploy@v1
with:
failOnStdErr: false
template: infra/deploy.bicep
resourceGroupName: ${{env.AZURE_RESOURCE_GROUP}}
subscriptionId: ${{secrets.SUBSCRIPTION_ID}}
additionalArguments: "--what-if"
parameters: >
projectName=SSW.Dory
- name: Deploy Bicep
uses: azure/arm-deploy@v1
with:
failOnStdErr: false
template: infra/deploy.bicep
resourceGroupName: ${{env.AZURE_RESOURCE_GROUP}}
subscriptionId: ${{secrets.SUBSCRIPTION_ID}}
parameters: >
projectName=SSW.Dory



62 changes: 1 addition & 61 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,61 +1 @@
# Created by https://www.toptal.com/developers/gitignore/api/ruby
# Edit at https://www.toptal.com/developers/gitignore?templates=ruby

### Ruby ###
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

# Ignore Byebug command history file.
.byebug_history

## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

# End of https://www.toptal.com/developers/gitignore/api/ruby
.DS_Store
7 changes: 0 additions & 7 deletions Gemfile

This file was deleted.

70 changes: 0 additions & 70 deletions Gemfile.lock

This file was deleted.

5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ SSW.Dory is a solution to keep track of SharePoint files that have been checked

## Architecture Diagram

![SSW Dory architecture diagram](./docs/assets/img/dory-architecture-diagram.png)

The solution is developed in Power Automate.
![Overview of SSW Dory Power Automate solution](./docs/assets/img/dory-power-automate-overview.png)
![SSW Dory architecture diagram](./docs/public/dory-architecture-diagram.svg)
Binary file removed docs/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
44 changes: 35 additions & 9 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# Ignore metadata generated by Jekyll
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# Ignore folders generated by Bundler
.bundle/
vendor/
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
Loading

0 comments on commit 265dcc5

Please sign in to comment.