Skip to content

Sanitize user input in AnalysisTriggerService and ThermalReferenceMet… #279

Sanitize user input in AnalysisTriggerService and ThermalReferenceMet…

Sanitize user input in AnalysisTriggerService and ThermalReferenceMet… #279

name: Deploy to Development
concurrency:
group: development-concurrency
cancel-in-progress: true
permissions:
contents: read
packages: write
on:
push:
branches:
- "main"
jobs:
get-short-sha:
outputs:
tag: ${{ steps.get-tag.outputs.tag }}
runs-on: ubuntu-latest
steps:
- id: get-tag
run: |
SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-8)
echo "tag=$SHA_SHORT" >> "$GITHUB_OUTPUT"
get-short-sha-for-workflow-notifier-folder:
outputs:
tag: ${{ steps.get-tag.outputs.tag }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
- id: get-tag
run: |
DIR_HASH=$(find workflow-notifier -type f -exec sha256sum {} + | sort | sha256sum | cut -c1-8)
echo "Computed DIR_HASH: $DIR_HASH"
echo "tag=$DIR_HASH" >> "$GITHUB_OUTPUT"
build-and-push-dev-images-to-ghcr:
name: Build and push dev images to github container registry
needs: [get-short-sha, get-short-sha-for-workflow-notifier-folder]
uses: equinor/armada/.github/workflows/build_and_publish_docker_image_to_container_registry.yml@main
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- image_name: ${{ github.repository }}
path_to_dockerfile: Dockerfile
path_to_context: .
short_sha_output: ${{ needs.get-short-sha.outputs.tag }}
- image_name: ${{ github.repository }}-workflow-notifier
path_to_dockerfile: workflow-notifier/Dockerfile
path_to_context: workflow-notifier
short_sha_output: ${{ needs.get-short-sha-for-workflow-notifier-folder.outputs.tag }}
with:
registry: ghcr.io
image_name: ${{ matrix.image_name }}
tag: "dev.${{ matrix.short_sha_output }}"
secondary_tag: dev
path_to_dockerfile: ${{ matrix.path_to_dockerfile }}
path_to_context: ${{ matrix.path_to_context }}
secrets:
registry_password: ${{ secrets.GITHUB_TOKEN }}
registry_username: ${{ github.actor }}
build-and-push-dev-images-to-aurora-dev-registry:
name: Build and push dev images to aurora dev registry
needs: [get-short-sha, get-short-sha-for-workflow-notifier-folder]
uses: equinor/armada/.github/workflows/build_and_publish_docker_image_to_container_registry.yml@main
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- image_name: robotics/sara
path_to_dockerfile: Dockerfile
path_to_context: .
short_sha_output: ${{ needs.get-short-sha.outputs.tag }}
- image_name: robotics/workflow-notifier
path_to_dockerfile: workflow-notifier/Dockerfile
path_to_context: workflow-notifier
short_sha_output: ${{ needs.get-short-sha-for-workflow-notifier-folder.outputs.tag }}
with:
registry: auroradevacr.azurecr.io
image_name: ${{ matrix.image_name }}
tag: "dev.${{ matrix.short_sha_output }}"
secondary_tag: dev
path_to_dockerfile: ${{ matrix.path_to_dockerfile }}
path_to_context: ${{ matrix.path_to_context }}
secrets:
registry_password: ${{ secrets.ROBOTICS_AURORADEVACR_PASSWORD }}
registry_username: ${{ secrets.ROBOTICS_AURORADEVACR_USERNAME }}
deploy:
name: Update deployment in Development
needs: [build-and-push-dev-images-to-aurora-dev-registry, get-short-sha, get-short-sha-for-workflow-notifier-folder]
uses: equinor/armada/.github/workflows/update_kubernetes_deployment.yml@main
permissions:
contents: read
strategy:
max-parallel: 1
matrix:
include:
- image_name: robotics/sara
short_sha_output: ${{ needs.get-short-sha.outputs.tag }}
- image_name: robotics/workflow-notifier
short_sha_output: ${{ needs.get-short-sha-for-workflow-notifier-folder.outputs.tag }}
with:
environment: development
registry: auroradevacr.azurecr.io
image_name: ${{ matrix.image_name }}
tag: "dev.${{ matrix.short_sha_output }}"
author_email: ${{ github.event.head_commit.author.email }}
author_name: ${{ github.event.head_commit.author.name }}
infrastructure_repository: equinor/analytics-infrastructure
secrets:
deploy_key: ${{ secrets.ANALYTICS_INFRASTRUCTURE_DEPLOY_KEY }}