Add note about the site being no longer operational #25
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
# Adapted from https://docs.microsoft.com/en-us/azure/aks/kubernetes-action | |
on: | |
push: | |
branches: | |
- master | |
# Environment variables available to all jobs and steps in this workflow | |
env: | |
REGISTRY_NAME: politiwatch | |
CLUSTER_NAME: core | |
CLUSTER_RESOURCE_GROUP: default | |
NAMESPACE: default | |
SECRET: container-pull-secret | |
APP_NAME: polititweet | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
# Connect to Azure Container Registry (ACR) | |
- uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ env.REGISTRY_NAME }}.azurecr.io | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
# Container build and push to a Azure Container Registry (ACR) | |
- run: | | |
docker build . -t ${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
# Set the target Azure Kubernetes Service (AKS) cluster. | |
- uses: azure/aks-set-context@v1 | |
with: | |
creds: "${{ secrets.AZURE_CREDENTIALS }}" | |
cluster-name: ${{ env.CLUSTER_NAME }} | |
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} | |
# Create image pull secret for ACR | |
- uses: azure/k8s-create-secret@v1 | |
with: | |
container-registry-url: ${{ env.REGISTRY_NAME }}.azurecr.io | |
container-registry-username: ${{ secrets.REGISTRY_USERNAME }} | |
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} | |
secret-name: ${{ env.SECRET }} | |
namespace: ${{ env.NAMESPACE }} | |
force: true | |
# Deploy app to AKS | |
- uses: azure/k8s-deploy@v1 | |
with: | |
manifests: | | |
manifests/constants-deployment.yaml | |
manifests/web-deployment.yaml | |
images: | | |
${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
imagepullsecrets: | | |
${{ env.SECRET }} | |
namespace: ${{ env.NAMESPACE }} |