-
Notifications
You must be signed in to change notification settings - Fork 205
40 lines (36 loc) · 1.25 KB
/
production_deploy.yml
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
36
37
38
39
40
name: Monitor 1-click Deployment
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'prod'
type: choice
options:
- stage
- prod
originalImageTag:
description: 'The original image tag that has been deployed to dockerhub'
required: true
type: string
env:
DOCKER_IMAGE_NAME: mozilla/blurts-server
jobs:
pull_retag_push:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull Docker image
run: docker pull ${{ env.DOCKER_IMAGE_NAME }}:${{ inputs.originalImageTag }}
- name: Retag image
run: docker tag ${{ env.DOCKER_IMAGE_NAME }}:${{ inputs.originalImageTag }} ${{ env.DOCKER_IMAGE_NAME }}:${{ inputs.environment }}-${{ inputs.originalImageTag }}
- name: Redeploy image
run: docker push ${{ env.DOCKER_IMAGE_NAME }}:${{ inputs.environment }}-${{ inputs.originalImageTag }}