Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gendercomics Database
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
phaidra-archive
Gendercomics Database
Commits
fa52cbc0
Commit
fa52cbc0
authored
1 month ago
by
michael litschauer
Browse files
Options
Downloads
Patches
Plain Diff
export-mongodb.yml 1st try
parent
a5573f48
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/export-mongodb.yml
+44
-0
44 additions, 0 deletions
.github/workflows/export-mongodb.yml
with
44 additions
and
0 deletions
.github/workflows/export-mongodb.yml
0 → 100644
+
44
−
0
View file @
fa52cbc0
name
:
Export MongoDB Collections
on
:
schedule
:
-
cron
:
'
0
0
*
*
*'
# Runs every day at midnight UTC
workflow_dispatch
:
# Allows manual triggering of the workflow
jobs
:
export
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout repository
uses
:
actions/checkout@v2
-
name
:
Set up MongoDB tools
run
:
sudo apt-get install -y mongodb-clients
-
name
:
Export MongoDB collections
env
:
MONGO_URI
:
${{ secrets.MONGO_URI }}
# Set this secret in your repository settings
run
:
|
mkdir -p gendercomics
mongoexport --uri="$MONGO_URI" --collection=comics --out=gendercomics/comics.json
mongoexport --uri="$MONGO_URI" --collection=keywords --out=gendercomics/keywords.json
mongoexport --uri="$MONGO_URI" --collection=names --out=gendercomics/names.json
mongoexport --uri="$MONGO_URI" --collection=persons --out=gendercomics/persons.json
mongoexport --uri="$MONGO_URI" --collection=predicates --out=gendercomics/predicates.json
mongoexport --uri="$MONGO_URI" --collection=publishers --out=gendercomics/publishers.json
mongoexport --uri="$MONGO_URI" --collection=roles --out=gendercomics/roles.json
mongoexport --uri="$MONGO_URI" --collection=texts --out=gendercomics/texts.json
-
name
:
Configure git
run
:
|
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
-
name
:
Commit and push changes
run
:
|
git add gendercomics/*.json
git commit -m "Export MongoDB collections as JSON files"
git push
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
# Automatically provided by GitHub Actions
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment