Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Atlas deploy to new workflows #2575

Merged
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
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
Loading