Skip to content

Commit

Permalink
MAV-745: Deploy infrastructure on push to main (#3099)
Browse files Browse the repository at this point in the history
- Call infrastructure deploy workflow
- Also remove explicit github.sha inputs
-- From documentation: `When a reusable workflow is triggered by a
caller workflow, the github context is always associated with the caller
workflow.`
  • Loading branch information
TheOneFromNorway authored Feb 27, 2025
2 parents ab8e989 + 4f6b136 commit 10e0516
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ name: Build Mavis image
on:
workflow_dispatch:
workflow_call:
inputs:
github_sha:
required: true
type: string

jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.github_sha || github.sha }}
- name: Build Docker image
run: |
docker build -t "mavis:latest" .
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/continuous_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ on:
jobs:
Test:
uses: ./.github/workflows/test.yml
with:
github_sha: ${{ github.sha }}
Build:
needs: Test
uses: ./.github/workflows/build.yml
with:
github_sha: ${{ github.sha }}
DeployInfrastructure:
needs: Test
Deploy:
uses: ./.github/workflows/deploy_infrastructure.yml
with:
environment: "copilotmigration"
DeployApplication:
needs: DeployInfrastructure
uses: ./.github/workflows/deploy_mavis.yml
with:
environment: "copilotmigration"
image_tag: ${{ github.sha }}
needs: Build
8 changes: 7 additions & 1 deletion .github/workflows/deploy_infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ on:
- test
- preview
- training
# - production
# - production
workflow_call:
inputs:
environment:
description: "Deployment environment"
required: true
type: string

env:
aws_role: ${{ inputs.environment == 'production'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/deploy_mavis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ on:
type: string
workflow_call:
inputs:
image_tag:
required: true
type: string
environment:
required: true
type: string
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Test
on:
pull_request:
workflow_call:
inputs:
github_sha:
required: true
type: string

jobs:
rails:
Expand All @@ -29,8 +25,6 @@ jobs:
RAILS_ENV: test
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.github_sha || github.sha }}
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
Expand All @@ -50,8 +44,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.github_sha || github.sha }}
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
Expand Down Expand Up @@ -81,8 +73,6 @@ jobs:
MAVIS__CIS2__ENABLED: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.github_sha || github.sha }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: .tool-versions
Expand Down

0 comments on commit 10e0516

Please sign in to comment.