@@ -8,29 +8,9 @@ permissions:
88 contents : read
99 issues : write
1010jobs :
11- properties :
12- name : Set properties
13- runs-on : ubuntu-latest
14- outputs :
15- date : ${{ steps.set-properties.outputs.DATE }}
16- version : ${{ steps.set-properties.outputs.VERSION }}
17- steps :
18- - uses : GitHubSecurityLab/actions-permissions/monitor@v1
19- with :
20- config : ${{ vars.PERMISSIONS_CONFIG }}
21- - name : Check out code
22- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
23- - name : Set properties
24- id : set-properties
25- run : |
26- DATE=$(date +'%Y-%m-%d')
27- VERSION=$(npm pkg get version | tr -d '"')
28- echo "DATE=${DATE}" >> "$GITHUB_OUTPUT"
29- echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
3011 push :
31- name : Build and publish docker image
12+ name : Set properties
3213 runs-on : ubuntu-latest
33- needs : properties
3414 env :
3515 IMAGE_REPOSITORY : docker.io/mongodb/apix_test
3616 TAG_PREFIX : mongodb-mcp-server-
@@ -40,29 +20,36 @@ jobs:
4020 config : ${{ vars.PERMISSIONS_CONFIG }}
4121 - name : Check out code
4222 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
43- with :
44- ref : v${{ needs.properties.outputs.version }}
4523 - name : Set up Docker Buildx
4624 uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
4725 - name : Login to Docker Hub
4826 uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
4927 with :
5028 username : " ${{ secrets.DOCKERHUB_USERNAME }}"
5129 password : " ${{ secrets.DOCKERHUB_SECRET }}"
30+ - name : Set properties
31+ id : set-properties
32+ run : |
33+ DATE=$(date +'%Y-%m-%d')
34+ VERSION=$(npm pkg get version | tr -d '"')
35+ echo "DATE=${DATE}" >> "$GITHUB_OUTPUT"
36+ echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
5237 - name : Build and push image to dockerhub registry
5338 uses : docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
5439 with :
5540 context : .
5641 platforms : linux/amd64,linux/arm64
5742 # TODO: add latest tag
58- tags : ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG_PREFIX }}${{ needs. properties.outputs.version }}, ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG_PREFIX }}${{ needs. properties.outputs.version }}-${{ needs. properties.outputs.date }}
43+ tags : ${{ 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 }}
5944 file : Dockerfile
6045 push : true
46+ build-args : |
47+ VERSION=${{ steps.set-properties.outputs.VERSION }}
6148 # - name: Create Issue
6249 # if: ${{ failure() }}
6350 # uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd
6451 # with:
6552 # labels: failed-release
66- # title: Release Failure for Docker Image ${{ env.TAG_PREFIX }}${{ needs. properties.outputs.version }}-${{ needs. properties.outputs.date }}
53+ # title: Release Failure for Docker Image ${{ env.TAG_PREFIX }}${{ steps.set- properties.outputs.VERSION }}-${{ steps.set- properties.outputs.DATE }}
6754 # body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
6855 # TODO: enable before merging
0 commit comments