Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Feb 15, 2024
1 parent 0dce397 commit 93a203b
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 2 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,69 @@ jobs:
- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')

publish-images:
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
include:
- vncserver: tigervnc
- vncserver: turbovnc

steps:
- uses: actions/checkout@v4

- name: Set up QEMU (for docker buildx)
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx (for multi-arch builds)
uses: docker/setup-buildx-action@v3

# 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]
#
# More details at
# https:/jupyterhub/action-major-minor-tag-calculator.
#
- name: Get image tags
id: tags
uses: jupyterhub/action-major-minor-tag-calculator@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
prefix: |
quay.io/jupyterhub/jupyter-remote-desktop-proxy:
suffix: |
${{ matrix.vncserver }}
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'
run: |
docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Build and push image
uses: docker/build-push-action@v5
with:
build-args: |
vncserver=${{ matrix.vncserver }}
context: .
platforms: linux/amd64,linux/arm64
push: ${{ steps.push_decision.outputs.push == 'true' }}
tags: ${{ join(fromJson(steps.tags.outputs.tags)) }}
16 changes: 14 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,29 @@ jobs:
container:
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- vncserver: tigervnc
- vncserver: turbovnc

steps:
- uses: actions/checkout@v4

- name: Build image
run: |
docker build -t jupyter-remote-desktop-proxy .
docker build --build-arg vncserver=${{ matrix.vncserver }} -t jupyter-remote-desktop-proxy .
- name: Smoke test image
run: |
docker run -d -p 8888:8888 -e JUPYTER_TOKEN=secret jupyter-remote-desktop-proxy
container_id=$(docker run -d -p 8888:8888 -e JUPYTER_TOKEN=secret jupyter-remote-desktop-proxy)
# -help flag is only available for TigerVNC, where TurboVNC can't
# print info without returning an error code.
docker exec $container_id vncserver -help || true
docker exec $container_id vncserver -list
sleep 10
curl 'http://localhost:8888/desktop/?token=secret' | grep 'Jupyter Remote Desktop Proxy'
# Test if the built JS file is present in the image
Expand Down

0 comments on commit 93a203b

Please sign in to comment.