Skip to content

Merge pull request #338 from G-Core/AnnaTonkova2-patch-7 #353

Merge pull request #338 from G-Core/AnnaTonkova2-patch-7

Merge pull request #338 from G-Core/AnnaTonkova2-patch-7 #353

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: [ main, dev ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=,suffix=-{{branch}},format=short
type=raw,value={{branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
push: true
build-args: |
ALGOLIA_PD_INDEX=${{ env.BRANCH == 'main' && 'product_documentation' || 'product_documentation_preprod' }}
ENVIRONMENT=${{ env.BRANCH == 'main' && 'prod' || 'preprod' }}
ALGOLIA_WRITE_KEY=${{ secrets.ALGOLIA_WRITE_KEY }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}