Skip to content

Commit

Permalink
Updated pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan committed Nov 9, 2023
1 parent 24a2906 commit 9fedd39
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 21 deletions.
56 changes: 35 additions & 21 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,63 @@
name: docker_build

on:
workflow_dispatch:
push:
branches:
- release/*

env:
REGISTRY: azbluefin.azurecr.io
workflow_call:
inputs:
registry:
required: true
type: string
file:
required: true
type: string
context:
required: true
type: string
secrets:
azureCredentials:
required: true
registryLoginServer:
required: true
registryUsername:
required: true
registryPassword:
required: true

jobs:
docker_build:
name: 'Build docker containers'
name: "Build docker containers and push to registry"
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: 'Checkout'
- name: Checkout
uses: actions/checkout@v4

- name: 'Login with Azure CLI'
- name: Login with Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
creds: ${{ secrets.azureCredentials }}

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

- name: 'Docker Login'
- name: "Docker Login"
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
login-server: ${{ secrets.registryLoginServer }}
username: ${{ secrets.registryUsername }}
password: ${{ secrets.registryPassword }}

- name: Build and push
uses: docker/build-push-action@v5
with:
tags: |
azbluefin.azurecr.io:latest
azbluefin.azurecr.io:${{ github.sha }}
context: .
${{ inputs.registry }}:latest
${{ inputs.registry }}:${{ github.sha }}
context: ${{ inputs.context }}
file: ${{ inputs.file }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
23 changes: 23 additions & 0 deletions .github/workflows/krill_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: krill_build

on:
workflow_dispatch:
push:
paths:
- samples/krill/**

env:
REGISTRY: azbluefin.azurecr.io/krill

jobs:
call-docker-build:
uses: ./.github/workflows/docker_build.yml
with:
registry: azbluefin.azurecr.io/krill
file: Dockerfile
context: ./samples/krill/
secrets:
azureCredentials: ${{ secrets.AZURE_CREDENTIALS }}
registryLoginServer: ${{ secrets.REGISTRY_LOGIN_SERVER }}
registryUsername: ${{ secrets.REGISTRY_USERNAME }}
registryPassword: ${{ secrets.REGISTRY_PASSWORD }}

0 comments on commit 9fedd39

Please sign in to comment.