Skip to content

Add api key auth to all bearer points (#121) #17

Add api key auth to all bearer points (#121)

Add api key auth to all bearer points (#121) #17

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
permissions:
id-token: write
contents: read
name: Upload Production Images
jobs:
build:
name: Build & Upload Images to ACR
environment: publish
strategy:
matrix:
image:
[
api-gateway,
auth-service,
db-service,
logging-service,
email-service,
]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Build ${{ matrix.image }} Image
run: docker build --build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} --target ${{ matrix.image }} -t junoservices.azurecr.io/${{ matrix.image }}:${{ github.ref_name }} .
- name: Get ACR credentials
id: get-acr-credentials
uses: azure/CLI@v1
with:
azcliversion: latest
inlineScript: |
echo "ACR_ACCESS_TOKEN=$(az acr login --name junoservices --expose-token --output tsv --query accessToken)" >> "$GITHUB_OUTPUT"
echo "ACR_LOGIN_SERVER=$(az acr login --name junoservices --expose-token --output tsv --query loginServer)" >> "$GITHUB_OUTPUT"
- name: Login to ACR
uses: azure/docker-login@v1
with:
login-server: ${{ steps.get-acr-credentials.outputs.ACR_LOGIN_SERVER }}
username: 00000000-0000-0000-0000-000000000000
password: ${{ steps.get-acr-credentials.outputs.ACR_ACCESS_TOKEN }}
- name: Push ${{ matrix.image }} Image
run: docker push junoservices.azurecr.io/${{ matrix.image }}:${{ github.ref_name }}