-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from osoc24/56-ama-setup-deployment
CD Workflow & deployment
- Loading branch information
Showing
10 changed files
with
119 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Loama CD | ||
|
||
on: | ||
push: | ||
branches: [ "root" ] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
controller-build: | ||
name: 'Controller Build' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: controller | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install PNPM | ||
with: | ||
version: latest | ||
run_install: false | ||
- name: Get pnpm store directory | ||
shell: bash | ||
id: cache | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v4 | ||
name: Setup PNPM cache | ||
env: | ||
STORE_PATH: ${{ steps.cache.outputs.STORE_PATH }} | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Insall dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Run Typescript Check | ||
run: pnpm run build >> $GITHUB_STEP_SUMMARY | ||
- name: Save distribution files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: controller-dist | ||
path: ${{github.workspace}}/controller/dist | ||
|
||
build: | ||
name: 'Deploy App' | ||
runs-on: ubuntu-latest | ||
needs: controller-build | ||
defaults: | ||
run: | ||
working-directory: loama | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Download controller dist | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: controller-dist | ||
path: ${{github.workspace}}/controller/dist | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install PNPM | ||
with: | ||
version: latest | ||
run_install: false | ||
- name: Get pnpm store directory | ||
shell: bash | ||
id: cache | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v4 | ||
name: Setup PNPM cache | ||
env: | ||
STORE_PATH: ${{ steps.cache.outputs.STORE_PATH }} | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies of controller | ||
working-directory: controller | ||
run: pnpm install --frozen-lockfile | ||
- name: Install dependencies of loama | ||
run: pnpm install --frozen-lockfile | ||
- name: Build applicaion | ||
run: pnpm run build | ||
- name: 'Dup `index.html` to `404.html` for redirects' | ||
run: cp dist/index.html dist/404.html | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# Upload dist folder | ||
path: ${{github.workspace}}/loama/dist | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters