-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_release_to_production.yml
More file actions
35 lines (29 loc) · 1.14 KB
/
deploy_release_to_production.yml
File metadata and controls
35 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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