Skip to content

chore(deps): bump @polkadot-cloud/react from 0.1.134 to 0.3.0 #124

chore(deps): bump @polkadot-cloud/react from 0.1.134 to 0.3.0

chore(deps): bump @polkadot-cloud/react from 0.1.134 to 0.3.0 #124

Workflow file for this run

name: Docker
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
permissions: read-all
jobs:
build:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Preview build configuration - Use relative paths
# NOTE: doesn't affect app functionality compared to a production build!
if: ${{ github.event_name == 'pull_request' }}
run: |
# Use relative paths for the PR preview build
sed -i "s|vite build --base '/'|vite build --base './'|" package.json
echo "===== DEBUG ====="
git diff
echo "===== END ====="
- name: Preview build configuration - Use 'development' mode
# WARNING: may affect app functionality compared to a production build!
# keep it enabled only for PRs against `dev` branch for now!
if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }}
run: |
# Specify development mode which activates the CreditcoinLocal network in the menu,
# which in turn enables testing the PR preview build with a locally running creditcoin3-node
sed -i "s|yarn build|export NODE_ENV='development' \&\& yarn build|" Dockerfile
echo "===== DEBUG ====="
git diff
echo "===== END ====="
- name: Build docker image
run: |
docker build -t gluwa/creditcoin3-staking-dashboard .
- name: Extract application files from docker image
if: ${{ github.event_name == 'pull_request' }}
run: |
docker images
docker run -d --rm --name ephemeral-container gluwa/creditcoin3-staking-dashboard
sleep 10
mkdir ./build/
docker cp ephemeral-container:/usr/share/nginx/html ./build/
docker kill ephemeral-container
- name: Install Azure cli tools
if: ${{ github.event_name == 'pull_request' }}
run: |
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-1-install-with-one-command
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Azure login
if: ${{ github.event_name == 'pull_request' && env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }}
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
allow-no-subscriptions: true
- name: Upload application files to Azure Storage
id: upload
if: ${{ github.event_name == 'pull_request' && env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }}
run: |
AZURE_STORAGE_KEY=${{ secrets.LLVM_AZURE_STORAGE_KEY }}
export AZURE_STORAGE_KEY
PR_NUMBER=$(echo "$GITHUB_REF" | sed "s|refs/pull/||" | sed "s|/merge||")
DESTINATION_PATH="cc3-staking-dashboard/PR-$PR_NUMBER"
export DESTINATION_PATH
az storage blob upload-batch --account-name staticsitellvmhtml --auth-mode key -d "\$web" --destination-path "$DESTINATION_PATH" --overwrite -s ./build/
echo "message=**Test before merge -> [Staking Dashboad Preview](https://staticsitellvmhtml.z13.web.core.windows.net/$DESTINATION_PATH/html/)!**" >> "$GITHUB_OUTPUT"
- name: Post comment to PR
if: ${{ github.event_name == 'pull_request' && env.GITHUB_TOKEN }}
uses: mshick/add-pr-comment@v2
env:
GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }}
with:
message: ${{ steps.upload.outputs.message }}
allow-repeats: false