Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases/mainnet/token dashboard/v1.21.0 #3769

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/dashboard-v1-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Token Dashboard / Mainnet

on:
pull_request:
branches: [main]
paths:
- solidity-v1/dashboard/**

# For pull_request_target:
# - Checkout with repository set to PR repo, ref same (see
# https://github.com/actions/checkout#usage).
# - Trigger from issue comment?

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build Docker Build Image
uses: docker/build-push-action@v2
with:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- # Temp fix - move cache instead of copying (added below step and
# modified value of `cache-to`).
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
# Without the change some jobs were failing with `no space left on device`
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

build-and-deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.11.x]

if: startsWith(github.head_ref, 'releases/mainnet/token-dashboard/')
defaults:
run:
working-directory: solidity-v1/dashboard
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# This step forces Git to download dependencies using `https://` protocol,
# even if `package-lock.json` refers to some package via `git://`. Using
# `git://` is no longer supported by GH. One of the `dashboard`
# dependencies by default uses `git://` and we needed to manually remove
# it every time it re-appeared in the lock file. Now even if it does,
# the `npm ci` will not fail.
- name: Configure git to don't use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- run: npm ci
#- run: npm run lint
#- if: github.event_name == 'push' TODO uncomment when mainnet builds happen this way
# run: npm run build --if-present
- if: github.event_name == 'pull_request'
run: npm run build
env:
PUBLIC_URL: /${{ github.head_ref }}
# A push event is a main merge; deploy to primary bucket.
# TODO uncomment when mainnet builds happen this way
#- if: github.event_name == 'push'
# name: Deploy Main to GCP
# uses: thesis/[email protected]
# with:
# service-key: ${{ secrets.KEEP_DASHBOARD_UPLOADER_SERVICE_KEY_JSON }}
# project: keep-prd-210b
# bucket-name: dashboard.keep.network
# build-folder: solidity-v1/dashboard/build
# A pull_request event is a PR; deploy to preview bucket.
- if: github.event_name == 'pull_request'
name: Deploy PR preview to GCP
uses: thesis/[email protected]
with:
service-key: ${{ secrets.KEEP_DASHBOARD_UPLOADER_SERVICE_KEY_JSON_BASE64 }}
project: keep-prd-210b
bucket-name: preview.dashboard.keep.network
bucket-path: ${{ github.head_ref }}
build-folder: solidity-v1/dashboard/build
# A pull_request event is a PR; leave a comment with the preview URL.
- if: github.event_name == 'pull_request'
name: Post preview URL to PR
uses: actions/github-script@v5
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Preview uploaded to https://preview.dashboard.keep.network/${{ github.head_ref }}/.'
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ spec:
spec:
containers:
- name: keep-dapp-token-dashboard
image: keepnetwork/token-dashboard:v1.19.0
image: keepnetwork/token-dashboard:v1.21.0
ports:
- containerPort: 80
3 changes: 2 additions & 1 deletion solidity-v1/dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apk add --update --no-cache \
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
COPY .env* /app/
COPY craco.config.js /app/

# Use `https://` instead of unauthenticated `git://` protocol
RUN git config --global url."https://".insteadOf git://
Expand All @@ -23,7 +24,7 @@ RUN npm ci --ignore-scripts
COPY src /app/src
COPY public /app/public

RUN npm run build
RUN NODE_OPTIONS=--max_old_space_size=4096 npm run build

# Production environment
FROM nginx:1.17-alpine
Expand Down
Loading
Loading