Skip to content

Deploying @v0.1.3 to Production #7

Deploying @v0.1.3 to Production

Deploying @v0.1.3 to Production #7

name: Deploy Release to Production
run-name: Deploying @${{ github.event.inputs.releaseTag }} to Production
concurrency: only-one-deployment-to-production
on:
workflow_dispatch:
inputs:
releaseTag:
description: 'Release Tag to Deploy to Production'
required: true
jobs:
deploy-latest:
name: Deploy Release to Production
runs-on: ubuntu-latest
steps:
- name: Check if Tag is Latest
if: ${{ github.event.inputs.releaseTag == 'latest' }}
run: exit 0
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Pull Docker Image
run: docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/quizhub:${{ github.event.inputs.releaseTag }}
- name: Tag Docker Image as Latest
run: |
docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/quizhub:${{ github.event.inputs.releaseTag }} ${{ secrets.DOCKER_HUB_USERNAME }}/quizhub:latest
- name: Push 'latest' Tag
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/quizhub:latest