diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index b13e9996d..32a80ea41 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -16,6 +16,10 @@ on: required: false type: boolean default: false + PUBLISH_LATEST: + required: false + type: boolean + default: false secrets: DATADOG_API_KEY: required: true @@ -38,12 +42,19 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set image tags + id: set-tags + run: | + TAGS="${{ inputs.IMAGE_PREFIX }}/speckle-server:${{ inputs.IMAGE_VERSION_TAG }}" + if [[ "${{ inputs.PUBLISH_LATEST }}" == "true" ]]; then + TAGS="$TAGS,${{ inputs.IMAGE_PREFIX }}/speckle-server:latest" + fi + echo "TAGS=$TAGS" >> "$GITHUB_OUTPUT" - name: Build and push uses: useblacksmith/build-push-action@v1 with: push: true - tags: | - ${{ inputs.IMAGE_PREFIX }}/speckle-server:${{ inputs.IMAGE_VERSION_TAG }} + tags: ${{ steps.set-tags.outputs.TAGS }} # TODO add docker hub tag, but only if we want to push to docker hub file: ./packages/server/Dockerfile build-args: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d115c19a0..83533037e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,7 @@ jobs: DOCKERHUB_USERNAME: 'speckledevops' IMAGE_PREFIX: 'speckle' # without an explicit host, Docker defaults to pushing Docker Hub PUBLISH: true # publish the sourcemaps and include the version in frontend-2 builds + PUBLISH_LATEST: ${{ startsWith(github.ref, 'refs/heads/main') }} secrets: inherit test-deployments: