Skip to content

Commit

Permalink
upd workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ivel13 committed Jun 19, 2024
1 parent 49c3842 commit ae0483d
Show file tree
Hide file tree
Showing 26 changed files with 106 additions and 2,004 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
72 changes: 0 additions & 72 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

Loading

0 comments on commit ae0483d

Please sign in to comment.