-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaction.yml
27 lines (27 loc) · 1.16 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: 'mongo-clone-action'
description: 'Github action to trigger mongoDB database clones via mongodump & mongorestore'
inputs:
source:
description: 'MongoDB connect url that includes username, password & database name you want to clone from'
required: true
target:
description: 'MongoDB connect url that includes username, password & database name you want to clone to'
required: true
runs:
using: "composite"
steps:
- name: Install Mongo Tools
run : |
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null
echo "deb [ arch=amd64 signed-by=/usr/share/keyrings/mongodb.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
sudo apt install mongodb-database-tools
mongodump --version
mongorestore --version
shell: bash
- name: Clone Database
run: ${{ github.action_path }}/clone.sh ${{ inputs.source }} ${{ inputs.target }}
shell: bash
branding:
icon: 'server'
color: 'gray-dark'