-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc1c9cf
commit 2d6798f
Showing
6 changed files
with
134 additions
and
0 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,30 @@ | ||
name: Setup DFX | ||
description: Setup DFX | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Get DFX version | ||
shell: bash | ||
run: echo "dfx_version=$(cat dfx.json | jq -r .dfx)" >> "$GITHUB_ENV" | ||
|
||
- name: Setup DFX | ||
uses: dfinity/setup-dfx@main | ||
with: | ||
dfx-version: ${{ env.dfx_version }} | ||
|
||
- name: Configure system subnet | ||
shell: bash | ||
run: | | ||
mkdir -p $HOME/.config/dfx | ||
cat <<EOF >$HOME/.config/dfx/networks.json | ||
{ | ||
"local": { | ||
"bind": "127.0.0.1:8080", | ||
"type": "ephemeral", | ||
"replica": { | ||
"subnet_type": "system" | ||
} | ||
} | ||
} | ||
EOF |
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,11 @@ | ||
name: Setup NodeJS | ||
description: Setup NodeJS | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
registry-url: 'https://registry.npmjs.org' |
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,27 @@ | ||
name: Setup PNPM | ||
description: Setup PNPM | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: ${{ runner.os }}-pnpm-store | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm i --frozen-lockfile |
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,32 @@ | ||
name: Build & test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build & test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/actions/setup-node | ||
|
||
- uses: ./.github/actions/setup-pnpm | ||
|
||
- uses: ./.github/actions/setup-dfx | ||
|
||
- name: Start DFX | ||
run: dfx start --background | ||
|
||
- name: Build Docs | ||
run: pnpm run -F docs... build | ||
|
||
- name: Stop DFX | ||
run: dfx stop |
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,29 @@ | ||
name: Deploy docs | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
deploy_docs: | ||
name: Deploy docs | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: mainnet | ||
url: https://docs.codegov.org | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/actions/setup-node | ||
|
||
- uses: ./.github/actions/setup-pnpm | ||
|
||
- uses: ./.github/actions/setup-dfx | ||
|
||
- name: Import DFX identity | ||
run: | | ||
echo ${{ secrets.MAINNET_PEM }} > ./mainnet.pem | ||
dfx identity import --ic --storage-mode plaintext mainnet ./mainnet.pem | ||
dfx use mainnet | ||
- name: Deploy docs to mainnet | ||
run: dfx deploy --ic docs |
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,5 @@ | ||
{ | ||
"docs": { | ||
"ic": "n5otb-3yaaa-aaaal-qcxzq-cai" | ||
} | ||
} |