Skip to content

test(): cover with different arguments case #830

test(): cover with different arguments case

test(): cover with different arguments case #830

name: Build and push docker image
on: [push]
env:
DOCKER_REPO: ${{ secrets.DOCKER_USERNAME }}/hawk-workers
jobs:
build:
runs-on: ubuntu-22.04
if: endsWith(github.ref, '/prod') || endsWith(github.ref, '/stage') || endsWith(github.ref, '/migration')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REPO }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable=${{ startsWith(github.ref, 'refs/heads') }}
- name: Build and push production image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: true