Skip to content

ADD: set default profile to true #12

ADD: set default profile to true

ADD: set default profile to true #12

name: Create User Mongo DB
on:
push:
branches:
- feat/atlas-mongo-db-gh-action
workflow_dispatch:
inputs:
email:
description: where to send the email
required: true
env:
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_API_KEY }}
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_API_KEY }}
MONGODB_ATLAS_ORG_ID: '6630fe6c4a18910569ad5e79'
jobs:
create-db:
runs-on: ubuntu-latest
steps:
- id: 'generate-db-id'
name: 'generate db id'
uses: 'yakubique/[email protected]'
with:
min: 111111
max: 999999
- id: 'generate-db-pw'
uses: aammirmirza/[email protected]
with:
length: 15
- name: Setup AtlasCLI and create a project
id: create-project
uses: mongodb/[email protected]
with:
create-project-name: ${{ steps.generate-db-id.outputs.number }}
- name: Run setup
id: setup
uses: mongodb/[email protected]
with:
run-setup: true
default: 'true'
project-id: ${{ steps.create-project.outputs.create-project-id }}
cluster-name: ${{ steps.generate-db-id.outputs.number }}
username: ${{ steps.generate-db-id.outputs.number }}
password: ${{ steps.generate-db-pw.outputs.password }}
- name: Retrieve Connection String
shell: bash
run: |
echo "${{ steps.setup.outputs.connection-string }}"