Skip to content

Update Dockerfile.ops-api #2

Update Dockerfile.ops-api

Update Dockerfile.ops-api #2

name: Dev BE ASA Pull Request
on:
workflow_dispatch:
pull_request:
branches:
- development
paths:
- backend/models/**
- backend/ops_api/**
- backend/Dockerfile.ops-api
env:
TERRAFORM_VERSION: "1.5.7"
TF_IN_AUTOMATION: "True"
ENVIRONMENT: "dev"
WORKING_DIR: "backend"
DOCKER_FILE: "Dockerfile.ops-api"
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and publish the Docker image for ${{ github.repository }}
uses: macbre/push-to-ghcr@v13
with:
image_name: ${{ github.repository }}/ops-${{ env.WORKING_DIR }} # it will be lowercased internally
github_token: ${{ secrets.GITHUB_TOKEN }}
context: ${{ github.workspace }}/${{ env.WORKING_DIR }}
dockerfile: ${{ github.workspace }}/${{ env.WORKING_DIR }}/${{ env.DOCKER_FILE }}
image_tag: ${{ github.sha }}
plan-deploy:
needs: build
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Terraform Plan
uses: ./.github/actions/tf-plan
with:
terraform_directory: "terraform/eus/${{ env.ENVIRONMENT }}/${{ env.WORKING_DIR }}_asa"
terraform_version: ${{ env.TERRAFORM_VERSION }}
azure_client_id: ${{ secrets.ARM_CLIENT_ID }}
azure_client_secret: ${{ secrets.ARM_CLIENT_SECRET }}
azure_subscription_id: ${{ secrets.ARM_SUBSCRIPTION_ID }}
azure_tenant_id: ${{ secrets.ARM_TENANT_ID }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_id: ${{ github.event.pull_request.number }}
tf_vars: |
{
"environment": "${{ env.ENVIRONMENT }}",
"container_tag": "${{ github.sha }}"
}