Workflow for manually pushing a Docker tag, refs #1281

This commit is contained in:
Simon Willison 2021-03-28 18:35:56 -07:00
commit 849c4f06ea

26
.github/workflows/push_docker_tag.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Push specific Docker tag
on:
workflow_dispatch:
inputs:
version_tag:
description: Tag to build and push
jobs:
deploy_docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and push to Docker Hub
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
VERSION_TAG: ${{ github.event.inputs.version_tag }}
run: |-
docker login -u $DOCKER_USER -p $DOCKER_PASS
export REPO=datasetteproject/datasette
docker build -f Dockerfile \
-t $REPO:${VERSION_TAG} \
--build-arg VERSION=${VERSION_TAG} .
docker tag $REPO:${VERSION_TAG}
docker push $REPO