Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/deploy_to_development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ concurrency:

permissions:
contents: read
packages: write

on:
push:
Expand All @@ -24,30 +23,29 @@ jobs:
SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-8)
echo "tag=$SHA_SHORT" >> "$GITHUB_OUTPUT"

build-and-push-flotilla-components-to-github-container-registry:
name: Build and push flotilla components to github container registry
build-and-push-flotilla-components-to-robotics-staging-registry:
name: Build and push flotilla components to robotics staging container registry
needs: get-short-sha
permissions:
contents: read
packages: write
strategy:
matrix:
component: [broker, backend, frontend]
uses: equinor/armada/.github/workflows/build_and_publish_docker_image_to_container_registry.yml@main
with:
registry: ghcr.io
image_name: ${{ github.repository }}-${{ matrix.component }}
registry: roboticsstagingacr.azurecr.io
image_name: robotics/flotilla-${{ matrix.component }}
tag: "dev.${{ needs.get-short-sha.outputs.tag }}"
secondary_tag: dev
path_to_dockerfile: ${{ matrix.component}}/Dockerfile
path_to_context: ./${{ matrix.component}}
secrets:
registry_password: ${{ secrets.GITHUB_TOKEN }}
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.ROBOTICS_ROBOTICSSTAGINGACR_PASSWORD }}
registry_username: ${{ secrets.ROBOTICS_ROBOTICSSTAGINGACR_USERNAME }}

deploy:
name: Update deployment in Development
needs: [build-and-push-flotilla-components-to-github-container-registry, get-short-sha]
needs: [build-and-push-flotilla-components-to-robotics-staging-registry, get-short-sha]
permissions:
contents: read
strategy:
Expand All @@ -57,8 +55,8 @@ jobs:
uses: equinor/armada/.github/workflows/update_kubernetes_deployment.yml@main
with:
environment: development
registry: ghcr.io
image_name: ${{ github.repository }}-${{ matrix.component }}
registry: roboticsstagingacr.azurecr.io
image_name: robotics/flotilla-${{ matrix.component }}
tag: "dev.${{ needs.get-short-sha.outputs.tag }}"
author_email: ${{ github.event.head_commit.author.email }}
author_name: ${{ github.event.head_commit.author.name }}
Expand Down
46 changes: 2 additions & 44 deletions .github/workflows/deploy_to_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ concurrency:
permissions:
contents: read
pull-requests: read
packages: write

on:
release:
Expand All @@ -26,51 +25,10 @@ jobs:
working_directory: backend/api
azure_subscription_id: ${{ vars.AZURE_SUBSCRIPTION_ID }}

build-and-push-flotilla-components-with-latest-tag-to-github-container-registry:
name: Build and push flotilla components with latest tag to github container registry
permissions:
contents: read
packages: write
strategy:
matrix:
component: [broker, backend, frontend]
uses: equinor/armada/.github/workflows/build_and_publish_docker_image_to_container_registry.yml@main
with:
registry: ghcr.io
image_name: ${{ github.repository }}-${{ matrix.component }}
tag: ${{ github.event.release.tag_name }}
secondary_tag: latest
path_to_dockerfile: ${{ matrix.component}}/Dockerfile
path_to_context: ./${{ matrix.component}}
secrets:
registry_password: ${{ secrets.GITHUB_TOKEN }}
registry_username: ${{ github.actor }}

build-and-push-latest-release-flotilla-component-to-aurora-prod-container-registry:
name: Build and push latest release flotilla components to aurora prod container registry
permissions:
contents: read
packages: write
strategy:
matrix:
component: [broker, backend, frontend]
uses: equinor/armada/.github/workflows/build_and_publish_docker_image_to_container_registry.yml@main
with:
registry: auroraprodacr.azurecr.io
image_name: robotics/flotilla-${{ matrix.component }}
tag: ${{ github.event.release.tag_name }}
secondary_tag: latest
path_to_dockerfile: ${{ matrix.component}}/Dockerfile
path_to_context: ./${{ matrix.component}}
secrets:
registry_password: ${{ secrets.AURORA_CONTAINER_REGISTRY_PROD_PASSWORD }}
registry_username: ${{ secrets.AURORA_CONTAINER_REGISTRY_PROD_USERNAME }}

build-and-push-latest-release-flotilla-component-to-robotics-staging-container-registry:
name: Build and push latest release flotilla components to robotics staging container registry
permissions:
contents: read
packages: write
strategy:
matrix:
component: [broker, backend, frontend]
Expand All @@ -90,15 +48,15 @@ jobs:
name: Update deployment in Staging
permissions:
contents: read
needs: build-and-push-latest-release-flotilla-component-to-aurora-prod-container-registry
needs: build-and-push-latest-release-flotilla-component-to-robotics-staging-container-registry
strategy:
max-parallel: 1
matrix:
component: [frontend, backend, broker]
uses: equinor/armada/.github/workflows/update_kubernetes_deployment.yml@main
with:
environment: staging
registry: auroraprodacr.azurecr.io
registry: roboticsstagingacr.azurecr.io
image_name: robotics/flotilla-${{ matrix.component }}
tag: ${{ github.event.release.tag_name }}
author_name: ${{ github.event.release.author.login }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/promote_to_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Get Flotilla version in staging
id: get_version_tag
run: |
TAG_LINE_NUMBER=$(($(grep -n "auroraprodacr.azurecr.io/robotics/flotilla-frontend" k8s_kustomize/overlays/staging/kustomization.yaml | cut --delimiter=":" --fields=1)+1))
TAG_LINE_NUMBER=$(($(grep -n "roboticsstagingacr.azurecr.io/robotics/flotilla-frontend" k8s_kustomize/overlays/staging/kustomization.yaml | cut --delimiter=":" --fields=1)+1))
VERSION_TAG=$(sed -n "${TAG_LINE_NUMBER}p" k8s_kustomize/overlays/staging/kustomization.yaml | cut --delimiter=":" --fields=2 | tr -d '[:space:]')
echo "tag=$VERSION_TAG" >> "$GITHUB_OUTPUT"

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
with:
environment: production
tag: ${{ needs.get_staging_version.outputs.versionTag }}
registry: auroraprodacr.azurecr.io
registry: roboticsprodacr.azurecr.io
image_name: robotics/flotilla-${{ matrix.component }}
author_name: ${{ github.actor }}
infrastructure_repository: equinor/robotics-infrastructure
Expand Down
Loading