Skip to content

fix spelling mistake #175

fix spelling mistake

fix spelling mistake #175

name: Build and deploy container (Production)
on:
push:
branches: [ main ]
workflow_dispatch:
#Special permissions required for deploying to Azure
permissions:
id-token: write
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup environment
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-$latest
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
cache-from: type=local,src=/tmp/.buildx-cache
target: deploy
push: true
tags: |
${{ vars.REGISTRY_REPO_PATH }}:latest
${{ vars.REGISTRY_REPO_PATH }}:${{ github.sha }}
# Clean up cache
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: production
url: api.hackthe6ix.com
steps:
- name: Log in to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CONTAINER_DEPLOY_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy Container App
uses: azure/cli@v2
with:
azcliversion: 2.74.0
inlineScript: |
az containerapp update -o none -n ${{ vars.CONTAINER_APP_NAME }} -g ${{ vars.CONTAINER_APP_RESOURCE_GROUP }} \
--image ${{ vars.REGISTRY_REPO_PATH }}:${{ github.sha }}