kopia lustrzana https://github.com/jupyterhub/repo2docker
Update release workflow for quay.io jupyterhub/repo2docker
rodzic
ca769b373c
commit
b45db5acf9
|
@ -35,6 +35,11 @@ jobs:
|
||||||
|
|
||||||
publish-docker:
|
publish-docker:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
env:
|
||||||
|
DEFAULT_REGISTRY: quay.io
|
||||||
|
IMAGE_NAME: jupyterhub/repo2docker
|
||||||
|
# Secrets are in a separate GitHub environment so only this job and branch has access
|
||||||
|
environment: quay.io
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# So that we can test this in PRs/branches
|
# So that we can test this in PRs/branches
|
||||||
|
@ -47,11 +52,11 @@ jobs:
|
||||||
- name: Should we push this image to a public registry?
|
- name: Should we push this image to a public registry?
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') }}" = "true" ]; then
|
if [ "${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') }}" = "true" ]; then
|
||||||
# Empty => Docker Hub
|
echo "REGISTRY=$DEFAULT_REGISTRY" >> $GITHUB_ENV
|
||||||
echo "REGISTRY=" >> $GITHUB_ENV
|
|
||||||
else
|
else
|
||||||
echo "REGISTRY=localhost:5000/" >> $GITHUB_ENV
|
echo "REGISTRY=localhost:5000" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
echo "Publishing to $REGISTRY"
|
||||||
|
|
||||||
# versioneer requires the full git history for non-tags
|
# versioneer requires the full git history for non-tags
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -72,18 +77,18 @@ jobs:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
|
|
||||||
- name: Setup push rights to Docker Hub
|
- name: Setup push rights to Docker Hub
|
||||||
if: env.REGISTRY != 'localhost:5000/'
|
if: env.REGISTRY != 'localhost:5000'
|
||||||
run: |
|
run: |
|
||||||
docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_TOKEN }}"
|
docker login -u "${{ secrets.DOCKER_REGISTRY_USERNAME }}" -p "${{ secrets.DOCKER_REGISTRY_TOKEN }}" "${{ env.REGISTRY }}"
|
||||||
|
|
||||||
# when building jupyter/repo2docker:master
|
# when building jupyter/repo2docker:master
|
||||||
# also push jupyter/repo2docker:1.2.3-3.abcd1234 (replace + with -)
|
# also push jupyter/repo2docker:1.2.3-3.abcd1234 (replace + with -)
|
||||||
- name: Get list of repo2docker docker tags
|
- name: Get list of repo2docker docker tags
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(python3 -c 'import versioneer; print(versioneer.get_version().replace("+", "-"))')
|
VERSION=$(python3 -c 'import versioneer; print(versioneer.get_version().replace("+", "-"))')
|
||||||
TAGS="${{ env.REGISTRY }}jupyter/repo2docker:$VERSION"
|
TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$VERSION"
|
||||||
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||||
TAGS="$TAGS,${{ env.REGISTRY }}jupyter/repo2docker:main"
|
TAGS="$TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main"
|
||||||
fi
|
fi
|
||||||
echo "TAGS=$TAGS"
|
echo "TAGS=$TAGS"
|
||||||
echo "TAGS=$TAGS" >> $GITHUB_ENV
|
echo "TAGS=$TAGS" >> $GITHUB_ENV
|
||||||
|
|
Ładowanie…
Reference in New Issue