Promote staging to production #19
Workflow file for this run
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: Promote staging to production | |
on: | |
push: | |
tags: | |
- '**' | |
workflow_dispatch: | |
jobs: | |
tag: | |
runs-on: | |
group: self-hosted | |
steps: | |
- name: Tag and notify | |
uses: IMIO/gha/[email protected] | |
with: | |
IMAGE_NAME: 'web/smartweb/mutual' | |
IMAGE_TAG: 'staging' | |
NEW_IMAGE_TAGS: | | |
latest | |
REGISTRY_URL: ${{ secrets.HARBOR_URL }} | |
REGISTRY_USERNAME: ${{ secrets.SMARTWEB_HARBOR_USERNAME }} | |
REGISTRY_PASSWORD: ${{ secrets.SMARTWEB_HARBOR_PASSWORD }} | |
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }} | |
deploy: | |
runs-on: | |
group: self-hosted | |
needs: [tag] | |
steps: | |
- name: Get tomorrow date | |
run: echo "DEPLOY_DATE=$(date --date='03:00 tomorrow' +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_ENV | |
- name: Deploy to production and notify | |
uses: IMIO/gha/[email protected] | |
with: | |
RUNDECK_URL: ${{ secrets.RUNDECK_URL }} | |
RUNDECK_TOKEN: ${{ secrets.SMARTWEB_RUNDECK_TOKEN }} | |
RUNDECK_JOB_ID: ${{ secrets.RUNDECK_DEPLOY_PROD_JOB_ID }} | |
RUNDECK_PARAMETERS: '-F "runAtTime=${{ env.DEPLOY_DATE }}"' | |
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }} |