Expressedrealms 129 fix data protection keys #79
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
--- | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# GitHub recommends pinning actions to a commit SHA. | |
# To get a newer version, you will need to update the SHA. | |
# You can also reference a tag or branch, but the action may change without warning. | |
name: Deploy API | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'api/**' | |
pull_request: | |
branches: [main] | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
id-token: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: noremacskich/expressedrealms-api | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: ./api | |
file: ./api/Dockerfile | |
push: true | |
tags: noremacskich/expressedrealms-api:${{ github.sha }} | |
labels: ${{ steps.meta.outputs.labels }} | |
#build-args: | # See #147, it's not passing through the parameter to the docker container | |
# MODE=production | |
# - name: Generate artifact attestation | |
# uses: actions/attest-build-provenance@v1 | |
# with: | |
# subject-name: noremacskich/expressedrealms-frontend | |
# subject-digest: ${{ steps.push.outputs.digest }} | |
# push-to-registry: true | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.EXPRESSEDREALMSAPI_AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.EXPRESSEDREALMSAPI_AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.EXPRESSEDREALMSAPI_AZURE_SUBSCRIPTION_ID }} | |
- name: Build and push container image to registry | |
uses: azure/container-apps-deploy-action@v2 | |
with: | |
registryUrl: ${{ vars.EXPRESSEDREALMSFRONTEND_REGISTRY_URL }} | |
registryUsername: ${{ secrets.EXPRESSEDREALMSFRONTEND_REGISTRY_USERNAME }} | |
registryPassword: ${{ secrets.EXPRESSEDREALMSAPI_REGISTRY_PASSWORD }} | |
imageToDeploy: ${{ vars.EXPRESSEDREALMSFRONTEND_REGISTRY_URL }}/noremacskich/expressedrealms-api:${{ github.sha }} | |
containerAppName: ca-expressedrealms-api | |
resourceGroup: RG_ExpressedRealms | |
environmentVariables: ASPNETCORE_ENVIRONMENT=secretref:aspnetcore-environment POSTMARK_API_KEY=secretref:postmark-api-key NO_REPLY_EMAIL=secretref:no-reply-email TEST_EMAIL_ADDRESS=secretref:test-email-address AZURE_POSTGRESSQL_CONNECTIONSTRING=secretref:azure-postgresql-connectionstring-6f940 FRONT_END_BASE_URL=secretref:front-end-base-url CLIENT_COOKIE_DOMAIN=secretref:client-cookie-domain AZURE_STORAGEBLOB_RESOURCEENDPOINT=secretref:azure-storageblob-resourceendpoint-08dee |