forked from blockscout/blockscout
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (95 loc) · 3.96 KB
/
build-push.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
on:
workflow_dispatch:
inputs:
version:
description: "Backend version"
default: "6.1.0"
required: true
name: Docker build and push
env:
IMAGE_REGISTRY: ${{ secrets.PROD_OVH_REGISTRY_URL }}
IMAGE_REPOSITORY: blockscout/backend
jobs:
check:
name: Check branch
runs-on: ubuntu-latest
steps:
- name: Exit if wrong branch
if: github.ref != 'refs/heads/production-harmony'
run: exit 1
indexer:
needs: check
name: Docker build and push - indexer
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to OVH Managed Private Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.PROD_OVH_REGISTRY_USERNAME }}
password: ${{ secrets.PROD_OVH_REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
- name: Prepare image tag
shell: bash
run: |
echo "IMAGE_TAG=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Build and push - indexer
run: |
docker build -t ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}-indexer:${{ env.IMAGE_TAG }} \
-t ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}-indexer:latest \
--build-arg BLOCKSCOUT_VERSION=v${{ github.event.inputs.version }} \
--build-arg RELEASE_VERSION=${{ github.event.inputs.version }} \
--build-arg DISABLE_WEBAPP=true \
--build-arg ADMIN_PANEL_ENABLED=false \
--build-arg CACHE_EXCHANGE_RATES_PERIOD= \
--build-arg API_V1_READ_METHODS_DISABLED=true \
--build-arg API_V1_WRITE_METHODS_DISABLED=true \
--build-arg CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=true \
--build-arg DECODE_NOT_A_CONTRACT_CALLS=false \
--build-arg MIXPANEL_URL= \
--build-arg MIXPANEL_TOKEN= \
--build-arg AMPLITUDE_URL= \
--build-arg AMPLITUDE_API_KEY= \
--build-arg CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= \
--cache-from blockscout/blockscout:buildcache \
-f ./docker/Dockerfile .
docker push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}-indexer --all-tags
api:
needs: check
name: Docker build and push - api
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to OVH Managed Private Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.PROD_OVH_REGISTRY_USERNAME }}
password: ${{ secrets.PROD_OVH_REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
- name: Prepare image tag
shell: bash
run: |
echo "IMAGE_TAG=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Build and push - api
run: |
docker build -t ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}-api:${{ env.IMAGE_TAG }} \
-t ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}-api:latest \
--build-arg BLOCKSCOUT_VERSION=v${{ github.event.inputs.version }} \
--build-arg RELEASE_VERSION=${{ github.event.inputs.version }} \
--build-arg DISABLE_WEBAPP=true \
--build-arg ADMIN_PANEL_ENABLED=false \
--build-arg CACHE_EXCHANGE_RATES_PERIOD= \
--build-arg API_V1_READ_METHODS_DISABLED=false \
--build-arg API_V1_WRITE_METHODS_DISABLED=false \
--build-arg CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=true \
--build-arg DECODE_NOT_A_CONTRACT_CALLS=false \
--build-arg MIXPANEL_URL= \
--build-arg MIXPANEL_TOKEN= \
--build-arg AMPLITUDE_URL= \
--build-arg AMPLITUDE_API_KEY= \
--build-arg CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= \
--cache-from blockscout/blockscout:buildcache \
-f ./docker/Dockerfile .
docker push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}-api --all-tags