Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build action #2

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading