Skip to content

Commit

Permalink
Build action (#2)
Browse files Browse the repository at this point in the history
* Build action

* Updated Dockerfile path
  • Loading branch information
k-karuna authored Jun 13, 2024
1 parent 9f1084b commit 8405fb1
Showing 1 changed file with 42 additions and 14 deletions.
56 changes: 42 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
name: Build

on:
pull_request:
push:
branches:
- main
- 'master'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'

jobs:
build-cardinal:
name: Cardinal
build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cardinal
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker Build
uses: docker/setup-buildx-action@v2
- name: Build Cardinal Docker Image
run: docker build .
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Cardinal

- name: Cardinal image tags & labels
id: meta-cardinal
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}-cardinal

- name: Cardinal image build & push
uses: docker/build-push-action@v2
with:
context: ./cardinal
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-cardinal.outputs.tags }}
labels: ${{ steps.meta-cardinal.outputs.labels }}

0 comments on commit 8405fb1

Please sign in to comment.