Merge pull request #135 from ic123-xyz/herbert-0222 #83
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
name: Deploy to Staging | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'LICENSE' | |
- 'README.md' | |
- 'canister_ids.json' | |
- 'cmd-change-domain' | |
- 'dns-setup' | |
- '.github/workflows/deploy-production.yml' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Prepare | |
run: | | |
# Install dfx. | |
wget --output-document install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/dfxvm-install-script/install.sh" | |
DFX_VERSION=${DFX_VERSION:=0.14.3} DFXVM_INIT_YES=true bash install-dfx.sh | |
rm install-dfx.sh | |
source "$HOME/.local/share/dfx/env" | |
# Prepare identity. | |
echo "${{secrets.WEIHAILU}}" > identity.pem | |
chmod 400 identity.pem | |
mkdir -p ~/.config/dfx/identity/default | |
mv identity.pem ~/.config/dfx/identity/default/identity.pem | |
dfx identity list | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Build | |
run: | | |
cd docusaurus | |
npm install | |
npm run build | |
cd .. | |
- name: Deploy | |
run: | | |
rm canister_ids.json | |
echo '{ "ic123_frontend": { "ic": "${{ vars.STAGING_CANISTER_ID }}" } }' > canister_ids.json | |
dfx start --background --clean | |
dfx deploy --network=ic | |
- name: Summarize | |
run: echo 'https://${{ vars.STAGING_CANISTER_ID }}.icp0.io' >> $GITHUB_STEP_SUMMARY |