Manual build and publish docker image #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manual build and publish docker image | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Image version' | |
required: true | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v2 | |
- name: Build image | |
run: make docker-build VERSION=${{ github.event.inputs.version }} | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DO_REGISTRY_RW }} | |
- name: Log in to DO Container Registry | |
run: doctl registry login --expiry-seconds 600 | |
- name: Tag image | |
run: | | |
docker tag world-builder:${{ github.event.inputs.version }} ${{ vars.DOCKER_REGISTRY_FQDN }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ github.event.inputs.version }} | |
- name: Push image to DO Container Registry | |
run: | | |
docker push ${{ vars.DOCKER_REGISTRY_FQDN }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ github.event.inputs.version }} | |