[feat]: details component #937
Workflow file for this run
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
name: Deploy review environment | |
on: | |
pull_request: | |
types: [ "opened", "synchronize", "labeled" ] | |
branches: [ "main" ] | |
env: | |
AZURE_CONTAINER_REGISTRY: "siaweuacrt4eij7yb42xum25r62" | |
CONTAINER_NAME: "frontend" | |
RESOURCE_GROUP: "sia-t-rg" | |
CLUSTER_NAME: "sia-weu-aks-t" | |
CHART_VERSION: "4.5.0" | |
jobs: | |
buildImage: | |
permissions: | |
contents: read | |
id-token: write | |
runs-on: ubuntu-latest | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'review') || github.event.label.name == 'review' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Azure login | |
uses: azure/[email protected] | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Build and push image to ACR | |
run: | | |
az acr build --image ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.RESOURCE_GROUP }} . | |
deploy: | |
permissions: | |
actions: read | |
contents: read | |
id-token: write | |
issues: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'review') || github.event.label.name == 'review' }} | |
needs: [ buildImage ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Azure login | |
uses: azure/[email protected] | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Get K8s context | |
uses: azure/aks-set-context@v3 | |
with: | |
resource-group: ${{ env.RESOURCE_GROUP }} | |
cluster-name: ${{ env.CLUSTER_NAME }} | |
admin: 'true' | |
- name: Helm add repository | |
run: | | |
helm repo add signalen https://signalen.github.io/helm-charts/ && helm repo update | |
- name: Helm upgrade (or install) | |
run: | | |
helm upgrade signalen-frontend signalen/frontend \ | |
--install \ | |
--version ${{ env.CHART_VERSION }} \ | |
--namespace frontend-${{ github.event.pull_request.number }} \ | |
--create-namespace \ | |
--values .github/review/values.yml \ | |
--set ingress.hosts[0].host=frontend-${{ github.event.pull_request.number }}.test.meldingen.amsterdam.delta10.cloud \ | |
--set ingress.hosts[0].paths[0].path=/ \ | |
--set ingress.hosts[0].paths[0].pathType=ImplementationSpecific \ | |
--set image.repository=${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }} \ | |
--set image.tag=${{ github.sha }} | |
- name: Comment review link to PR | |
uses: thollander/actions-comment-pull-request@v1 | |
with: | |
message: | | |
Deployed review environment to https://frontend-${{ github.event.pull_request.number }}.test.meldingen.amsterdam.delta10.cloud 🚀 | |
comment_includes: 'Deployed review environment to' |