Skip to content

Merge branch 'staging-harmony' into production-harmony #20

Merge branch 'staging-harmony' into production-harmony

Merge branch 'staging-harmony' into production-harmony #20

Workflow file for this run

on:
push:
branches:
- 'production-harmony'
name: Docker build and push
env:
IMAGE_REGISTRY: ${{ secrets.PROD_OVH_REGISTRY_URL }}
IMAGE_REPOSITORY: blockscout/frontend
jobs:
push:
name: Docker build and push
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
run: |
docker build -t ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }} -t ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }}:latest --build-arg GIT_COMMIT_SHA=${{ env.IMAGE_TAG }} --build-arg GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} -f Dockerfile .
docker push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPOSITORY }} --all-tags