Skip to content

add github actions #158

add github actions

add github actions #158

Workflow file for this run

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
manual_approval_test:
runs-on: ubuntu-latest
needs: deploy-to-radix
if: github.event.inputs.approve == 'true'
steps:
- name: Approval Step
run: echo "Manual approval granted. Proceeding."
# 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: manual_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