-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
26 additions
and
6 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,22 +1,42 @@ | ||
name: Run Azure Login with OIDC | ||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
pull_request: | ||
branches: | ||
- dev | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
jobs: | ||
build-and-deploy: | ||
build-orchestrator: | ||
runs-on: ubuntu-latest | ||
environment: build | ||
strategy: | ||
matrix: | ||
include: | ||
- dockerfile: Dockerfile-api_orchestrator | ||
image-name: terravibes-api-orchestrator | ||
- dockerfile: Dockerfile-worker | ||
image-name: terravibes-worker | ||
- dockerfile: Dockerfile-cache | ||
image-name: terravibes-cache | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: 'Az CLI login' | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: 'Run az commands' | ||
- name: 'Build and push image' | ||
run: | | ||
az account show | ||
az group list | ||
az acr login -n ${{ secrets.ACR_NAME }} | ||
docker build -f ./resources/${{ matrix.dockerfile }} -t ${{ secrets.ACR_NAME }}.azurecr.io/${{ matrix.image-name }}:test | ||
docker push ${{ secrets.ACR_NAME }}.azurecr.io/${{ matrix.image-name }}:test | ||