diff --git a/.github/workflows/push-docker-images.yml b/.github/workflows/push-docker-images.yml index 012473e..2796600 100644 --- a/.github/workflows/push-docker-images.yml +++ b/.github/workflows/push-docker-images.yml @@ -52,14 +52,17 @@ jobs: images: ${{ fromJson(needs.set-matrix.outputs.docker_images) }} steps: - - name: Get tag name - id: get-tag-name + - name: Get publish date + id: get-publish-date uses: actions/github-script@v7 with: script: | - const tagName = "${{ github.event.inputs.branch }}" || 'latest'; - console.log('Will use tag: ' + tagName); - return tagName; + const date = new Date(); + const year = date.getUTCFullYear(); + const month = String(date.getUTCMonth() + 1).padStart(2, '0'); + const day = String(date.getUTCDate()).padStart(2, '0'); + const dateTag = `${year}${month}${day}`; + return dateTag result-encoding: string - name: Set up Docker Buildx @@ -74,9 +77,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Set build date tag - run: echo "PUBLISH_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV - - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: @@ -84,7 +84,7 @@ jobs: push: true platforms: ${{ matrix.images.os_platform }} target: ${{ matrix.images.target }} - tags: edxops/${{matrix.images.image_name}}-dev:test, edxops/${{matrix.images.image_name}}-dev:$BUILD_DATE + tags: edxops/${{matrix.images.image_name}}-dev:test, edxops/${{matrix.images.image_name}}-dev:${{ steps.get-publish-date.outputs.result }} # ${{ steps.get-tag-name.outputs.result }} - name: Send failure notification