add github actions #157
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: build completion | |
on: | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment to deploy to' | |
required : true | |
type: choice | |
default: dev | |
options: | |
- dev | |
- test | |
- prod | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
runtests: | |
uses: equinor/procosys-completion-api/.github/workflows/runtests.yaml@github-action-pipeline | |
secrets: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
with: | |
deployment: 'runtests' | |
environment: 'dev' | |
testPath: './Equinor.ProCoSys.Completion.sln' | |
build-and-push-docker: | |
needs: runtests | |
uses: equinor/procosys-completion-api/.github/workflows/build-and-push-docker.yaml@github-action-pipeline | |
secrets: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
with: | |
repositoryName: procosys-completion | |
dockerFilePath: ./src/Dockerfile | |
environment: dev | |
version: 1.000.0.${{github.run_id}} | |
deploy-to-radix: | |
needs: build-and-push-docker | |
uses: equinor/procosys-completion-api/.github/workflows/deploy-to-radix.yaml@github-action-pipeline | |
secrets: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
with: | |
applicationName: procosys-completion-api | |
componentName: backend | |
imageTag: 1.000.0.${{github.run_id}} | |
environment: dev | |
approval-test: | |
runs-on: ubuntu-latest | |
environment: | |
name: test # Define an environment that requires approval in repository settings | |
needs: deploy-to-radix | |
steps: | |
- name: Await Approval | |
run: echo "Job is approved, continuing to next steps" | |
deploy-to-radix-test: | |
needs: approval-test | |
uses: equinor/procosys-completion-api/.github/workflows/deploy-to-radix.yaml@github-action-pipeline | |
secrets: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
with: | |
applicationName: procosys-completion-api | |
componentName: backend | |
imageTag: 1.000.0.${{github.run_id}} | |
environment: test |