Skip to content

chore: Docker Workflow #21

chore: Docker Workflow

chore: Docker Workflow #21

Workflow file for this run

name: Mindpress Mainnet Docker Image CI # rename Github Action ###
on:
pull_request:
branches: [main]
push:
branches: [ui]
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
IMAGE_SOURCE: https://github.com/${{ github.repository }}
CI: false
### IMPORTANT !!!! ###
### The following three need to be modified according to your project ###
APP_NAME: mindpress ### your application name
jobs:
build:
runs-on: ubuntu-latest
# if: "contains(github.event.head_commit.message, 'aptos-trace')"
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- uses: ./.github/actions/ci-setup
- name: Build React App
env:
REACT_APP_NET_ENV: MAINNET
REACT_APP_BANNER_IDS: ""
PUBLIC_URL: https://marketplace.mindpress.io
GENERATE_SOURCEMAP: false
REACT_APP_GF_EXPLORER_URL: https://greenfieldscan.com/
REACT_APP_BSC_EXPLORER_URL: https://www.bscscan.com/
REACT_APP_DCELLAR_URL: https://dcellar.io/
REACT_APP_GF_CHAIN_ID: 1017
REACT_APP_GF_RPC_URL: https://greenfield-chain.bnbchain.org:443
REACT_APP_BSC_RPC_URL: https://bsc-dataseed1.binance.org
REACT_APP_BSC_CHAIN_ID: 56
REACT_APP_MARKETPLACE_CONTRACT_ADDRESS: "0x1FdBF1726Cf853Cc340e68bae68Dc6a5b6301DeE"
REACT_APP_GROUP_HUB_CONTRACT_ADDRESS: "0xDd9af4573D64324125fCa5Ce13407be79331B7F7"
REACT_APP_MULTI_CALL_CONTRACT_ADDRESS: "0xcA11bde05977b3631167028862bE2a173976CA11"
REACT_APP_ERC1155_TRANSFER_CONTRACT_ADDRESS: "0xAb73f243Be4d0fC5644c822351eC77e85DC2B5Ea"
REACT_APP_ERC721_TRANSFER_CONTRACT_ADDRESS: "0x943FAC6CEBE6e45CE59bA911E5B6447c1a991450"
REACT_APP_NETWORK: Mainnet
REACT_APP_DAPP_NAME: mindv05
G_TAG: G-VRYHWMVQ50
REACT_APP_API_DOMAIN: https://api-marketplace.mindpress.io/v1/
REACT_APP_CROSS_CHAIN_FEE: 0.000001
REACT_APP_INITIATE_LIST_FEE: 0.00003
REACT_APP_LIST_FEE_ON_GF: 0.0000036
REACT_APP_LIST_ESTIMATE_FEE_ON_BSC: 0.0000036
REACT_APP_BSC_SEND_GAS_FEE: 10000000000
run: |
pnpm run build
- name: Build Image
run: |
docker build . \
--label "org.opencontainers.image.source=${IMAGE_SOURCE}" \
--label "org.opencontainers.image.revision=$(git rev-parse HEAD)" \
--label "org.opencontainers.image.version=$(git describe --tags --abbrev=0)" \
--label "org.opencontainers.image.licenses=AGPL-3.0" \
-f ./Dockerfile -t "${IMAGE_NAME}"
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: |
# Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION = ${GITHUB_SHA::8}
# Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
# [ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_NAME=$IMAGE_NAME
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_NAME:$VERSION
docker tag $IMAGE_NAME $IMAGE_NAME:latest
docker push $IMAGE_NAME:$VERSION
docker push $IMAGE_NAME:latest