-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ethan
committed
Nov 9, 2023
1 parent
24a2906
commit 9fedd39
Showing
2 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |