-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (47 loc) · 1.98 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build and Deploy Docker Image
on:
push:
branches:
- main
# - dev
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine version
id: version
run: |
version=$(jq -r '.version' package.json)-rc.${{ github.sha }}
networkId=421614
networkUrl=https://arbitrum-sepolia.blockpi.network/v1/rpc/public
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
version=$(jq -r '.version' package.json)
networkId=42161
networkUrl=https://arbitrum.blockpi.network/v1/rpc/public
fi
echo "::set-output name=version::$version"
echo "::set-output name=networkId::$networkId"
echo "::set-output name=networkUrl::$networkUrl"
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/arm64
build-args: |
REACT_APP_NETWORK_ID=${{ steps.version.outputs.networkId }}
REACT_APP_NETWORK_URL=${{ steps.version.outputs.networkUrl }}
REACT_APP_WALLET_CONNECT_PROJECT_ID=fb1d2dba2f157d3d719134e58dda98a7
tags: ghcr.io/${{ github.repository_owner }}/od-app:${{ steps.version.outputs.version }}