|
| 1 | +# See RELEASING.md#DockerImage for more details about the steps in this workflow. |
| 2 | +name: Daily Release AtlasCLI Docker Image |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "0 1 * * *" # Every day at 1:00 AM |
| 6 | + workflow_dispatch: # Run the action manually |
| 7 | + pull_request: # TODO: delete this before merging |
| 8 | +jobs: |
| 9 | + build_images: |
| 10 | + name: Build and publish docker image to staging registry |
| 11 | + runs-on: ubuntu-latest |
| 12 | + env: |
| 13 | + IMAGE_REPOSITORY: docker.io/mongodb/apix_test |
| 14 | + TAG_PREFIX: mongodb-mcp-server |
| 15 | + steps: |
| 16 | + - uses: GitHubSecurityLab/actions-permissions/monitor@v1 |
| 17 | + with: |
| 18 | + config: ${{ vars.PERMISSIONS_CONFIG }} |
| 19 | + - name: Check out code |
| 20 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 |
| 21 | + - name: Set properties |
| 22 | + id: set-properties |
| 23 | + run: | |
| 24 | + DATE=$(date +'%Y-%m-%d') |
| 25 | + VERSION=$(npm pkg get version | tr -d '"') |
| 26 | + echo "DATE=${DATE}" >> "$GITHUB_OUTPUT" |
| 27 | + echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" |
| 28 | + - name: Set up Docker Buildx |
| 29 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 |
| 30 | + - name: Login to Docker Hub |
| 31 | + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d |
| 32 | + with: |
| 33 | + username: "${{ secrets.DOCKERHUB_USER }}" |
| 34 | + password: "${{ secrets.DOCKERHUB_SECRET }}" |
| 35 | + - name: Build and push image to dockerhub staging registry |
| 36 | + uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 |
| 37 | + with: |
| 38 | + context: . |
| 39 | + platforms: linux/amd64,linux/arm64 |
| 40 | + tags: |
| 41 | + ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG_PREFIX }}${{ steps.set-properties.outputs.VERSION }}, ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG_PREFIX }}${{ steps.set-properties.outputs.VERSION }}-${{ steps.set-properties.outputs.DATE }} |
| 42 | + file: Dockerfile |
| 43 | + push: true |
| 44 | + # - name: Create Issue |
| 45 | + # if: ${{ failure() }} |
| 46 | + # uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd |
| 47 | + # with: |
| 48 | + # labels: failed-release |
| 49 | + # title: Release Failure for Atlas CLI Docker Image ${{ env.TAG_PREFIX }}${{ steps.set-properties.outputs.VERSION }}-${{ steps.set-properties.outputs.DATE }} |
| 50 | + # body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
0 commit comments