Skip to content

Commit

Permalink
Merge pull request #2575 from aiidtest/feature-realm-deploy
Browse files Browse the repository at this point in the history
Add Atlas deploy to new workflows
  • Loading branch information
kepae authored Jan 26, 2024
2 parents c012694 + 98e3c50 commit 0d22c7a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/realm-staging.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/realm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Realm Deploy

on:
workflow_call:
inputs:
environment:
description: The Github environment to load secrets from
type: string
required: true
sha:
description: The commit SHA to deploy
type: string
required: true

jobs:
push:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}

- name: "Install the Realm (Atlas) CLI"
run: |
npm install -g mongodb-realm-cli
- name: Login
run: |
realm-cli login --api-key="${{ secrets.REALM_API_PUBLIC_KEY }}" --private-api-key="${{ secrets.REALM_API_PRIVATE_KEY }}" --realm-url https://realm.mongodb.com --atlas-url https://cloud.mongodb.com
- name: Push
run: |
cd site/realm
realm-cli push --remote="${{ vars.GATSBY_REALM_APP_ID }}" -y
8 changes: 8 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ on:

jobs:

call-atlas:
uses: ./.github/workflows/realm.yml
secrets: inherit
with:
sha: ${{ github.sha }}
environment: staging

call-test-build:
uses: ./.github/workflows/test-build.yml
secrets: inherit
needs: call-atlas
with:
sha: ${{ github.sha }}
environment: staging
Expand Down

0 comments on commit 0d22c7a

Please sign in to comment.