From a8f8d5148ce67c891f5959281c27a5052f31b2d5 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 15 Feb 2024 23:12:28 +0100 Subject: [PATCH] ci: update to use not yet released image tagging stuff --- .github/workflows/release.yaml | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 68403cca..f3cb803e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -77,6 +77,24 @@ jobs: - name: Set up Docker Buildx (for multi-arch builds) uses: docker/setup-buildx-action@v3 + - name: Make decisions to push etc. + id: decisions + run: | + if [ "${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') }}" = "true" ]; then + echo "push=true" >> $GITHUB_OUTPUT + else + echo "push=false" >> $GITHUB_OUTPUT + fi + + # We provide image tags with -tigervnc and -turbovnc suffixes to allow + # for an explicit choice, but also ship with a default choice of + # TigerVNC. + if [ "${{ matrix.vncserver == 'tigervnc') ]; then + echo "suffix=,-${{ matrix.vncserver }}" >> $GITHUB_OUTPUT + else + echo "suffix=-${{ matrix.vncserver }}" >> $GITHUB_OUTPUT + fi + # For builds triggered by a git tag 1.2.3, we calculate image tags like: # [{prefix}:1.2.3, {prefix}:1.2, {prefix}:1, {prefix}:latest] # @@ -88,29 +106,17 @@ jobs: uses: jupyterhub/action-major-minor-tag-calculator@v3 with: githubToken: ${{ secrets.GITHUB_TOKEN }} - prefix: | - quay.io/jupyterhub/jupyter-remote-desktop-proxy: - suffix: | - - ${{ matrix.vncserver }} + prefix: "quay.io/jupyterhub/jupyter-remote-desktop-proxy:" + suffix: ${{ steps.decisions.outputs.suffix }} branchRegex: ^\w[\w-.]*$ defaultTag: quay.io/jupyterhub/jupyter-remote-desktop-proxy:noref - - name: Decide to push or not - id: push_decision - run: | - if [ "${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') }}" = "true" ]; then - echo "push=true" >> $GITHUB_OUTPUT - else - echo "push=false" >> $GITHUB_OUTPUT - fi - - name: Login to container registry # Credentials to Quay.io was setup by... # 1. Creating a [Robot Account](https://quay.io/organization/jupyterhub?tab=robots) # 2. Giving it push permissions to the image repository # 3. Adding Robot Account credentials as workflow environment secrets - if: steps.push_decision.outputs.push == 'true' + if: steps.decisions.outputs.push == 'true' run: | docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io @@ -121,5 +127,5 @@ jobs: vncserver=${{ matrix.vncserver }} context: . platforms: linux/amd64,linux/arm64 - push: ${{ steps.push_decision.outputs.push == 'true' }} + push: ${{ steps.decisions.outputs.push }} tags: ${{ join(fromJson(steps.tags.outputs.tags)) }}