Skip to content

Commit

Permalink
chore(nammatham): fix pipeline deploy for pnpm on Azure Static Site
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 7, 2024
1 parent f8bac80 commit e124aca
Show file tree
Hide file tree
Showing 8 changed files with 2,992 additions and 9,537 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/azure-static-web-apps-red-river-09ad3dc00.yml

This file was deleted.

27 changes: 22 additions & 5 deletions .github/workflows/deploy-home.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Deploy Home Site

on: [push]
on:
push:
branches:
- main
paths:
- 'apps/home/**'
- '.github/workflows/deploy-home.yml'

permissions:
contents: write
Expand All @@ -18,17 +24,28 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v4

- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: ${{ env.pnpm_version }}

- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.node_version }}

- uses: pnpm/action-setup@v3
name: Install pnpm
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
version: ${{ env.pnpm_version }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/deploy-nammatham.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Deploy Nammatham Site

on:
push:
branches:
- main
paths:
- 'apps/nammatham/**'
- '.github/workflows/deploy-nammatham.yml'
# pull_request:
# types: [opened, synchronize, reopened, closed]
# branches:
# - main
env:
pnpm_version: 8
node_version: 20

jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: ${{ env.pnpm_version }}

- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: ${{ env.node_version }}


- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm exec nx run nammatham:build

- name: Deploy
run: pnpm exec nx run nammatham:deploy
env:
SWA_CLI_DEPLOYMENT_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_RED_RIVER_09AD3DC00 }}


# build_and_deploy_job:
# if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
# runs-on: ubuntu-latest
# name: Build and Deploy Job
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# lfs: false
# - name: Build And Deploy
# id: builddeploy
# uses: Azure/static-web-apps-deploy@v1
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_RED_RIVER_09AD3DC00 }}
# repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
# action: "upload"
# ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
# app_location: "/" # App source code path
# api_location: "" # Api source code path - optional
# output_location: "/" # Built app content directory - optional
# ###### End of Repository/Build Configurations ######

# close_pull_request_job:
# if: github.event_name == 'pull_request' && github.event.action == 'closed'
# runs-on: ubuntu-latest
# name: Close Pull Request Job
# steps:
# - name: Close Pull Request
# id: closepullrequest
# uses: Azure/static-web-apps-deploy@v1
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_RED_RIVER_09AD3DC00 }}
# action: "close"
18 changes: 9 additions & 9 deletions apps/nammatham/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
title: 'Nammatham',
tagline: 'Azure Functions Framework',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
url: 'https://nammatham.thaitype.dev',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
organizationName: 'thaitype', // Usually your GitHub org/user name.
projectName: 'nammatham', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
Expand Down Expand Up @@ -70,7 +70,7 @@ const config: Config = {
position: 'left',
label: 'Tutorial',
},
{to: '/blog', label: 'Blog', position: 'left'},
{ to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
Expand Down Expand Up @@ -121,7 +121,7 @@ const config: Config = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} ThaiType, Inc. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
Expand Down
Loading

0 comments on commit e124aca

Please sign in to comment.