-
Notifications
You must be signed in to change notification settings - Fork 30
feat: docker support #238
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
feat: docker support #238
Changes from all commits
5e83257
e2430ab
c07a174
fd0ebb7
900626a
2e5b4be
968cd27
8a04017
528b4f1
d92b95f
7030f93
fabb1c8
ee0ae2b
4b44f9b
4fd4a6f
6c714b3
f7ef003
9f7370e
440b3cf
e12a318
5ede17a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Daily Release Docker Image | ||
on: | ||
schedule: | ||
- cron: "0 1 * * *" # Every day at 1:00 AM | ||
workflow_dispatch: # Run the action manually | ||
permissions: | ||
contents: read | ||
issues: write | ||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
with: | ||
config: ${{ vars.PERMISSIONS_CONFIG }} | ||
- name: Check out code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d | ||
with: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_PASSWORD }}" | ||
- name: Set date and version | ||
id: set-properties | ||
run: | | ||
DATE=$(date +'%Y-%m-%d') | ||
VERSION=$(npm pkg get version | tr -d '"') | ||
echo "DATE=${DATE}" >> "$GITHUB_OUTPUT" | ||
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" | ||
- name: Build and push image to dockerhub registry | ||
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ vars.DOCKERHUB_IMAGE_REPOSITORY }}:latest, ${{ vars.DOCKERHUB_IMAGE_REPOSITORY }}:${{ steps.set-properties.outputs.VERSION }}, ${{ vars.DOCKERHUB_IMAGE_REPOSITORY }}:${{ steps.set-properties.outputs.VERSION }}-${{ steps.set-properties.outputs.DATE }} | ||
file: Dockerfile | ||
push: true | ||
build-args: | | ||
VERSION=${{ steps.set-properties.outputs.VERSION }} | ||
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We typically use the bot in cases where the actions token wouldn't work - e.g. if we want to open a PR, but also run the associated workflows (which wouldn't happen with the GHA token). In this case, unless we want to run follow-up workflows on the newly created issue, we should be able to just use the GHA token. Alternatively, if we need the bot token, we can remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was intentional, as we intend to run GitHub actions on GitHub Issues (Jira integration). If an issue is created by Github Actions user, it won't run further GitHub Actions. |
||
id: app-token | ||
if: ${{ failure() }} | ||
with: | ||
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} | ||
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} | ||
- name: Create Issue | ||
if: ${{ failure() }} | ||
uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd | ||
with: | ||
token: ${{ steps.app-token.outputs.token }} | ||
title: Release Failure for Docker Image ${{ steps.set-properties.outputs.VERSION }}-${{ steps.set-properties.outputs.DATE }} | ||
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
labels: "docker, release_failure" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:22-alpine | ||
ARG VERSION=latest | ||
RUN npm install -g mongodb-mcp-server@${VERSION} | ||
ENTRYPOINT ["mongodb-mcp-server"] | ||
LABEL maintainer="MongoDB Inc <info@mongodb.com>" | ||
LABEL description="MongoDB MCP Server" | ||
LABEL version=${VERSION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this? Doesn't seem like it's created.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://github.com/GitHubSecurityLab/actions-permissions/tree/v1/monitor, it is advisable to keep a variable even if it does not exist yet.