Skip to content

v2.0.22

v2.0.22 #78

name: Deploy instances (production)
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
vars:
runs-on: ubuntu-latest
steps:
- id: tag_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
outputs:
version: ${{ steps.tag_version.outputs.VERSION }}
environment: production
pre-deploy:
needs: [vars]
runs-on: ubuntu-latest
steps:
- name: Notify start
run: npx @parameter1/base-cms-newsletter-deployment-tool notify-started
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
ENVIRONMENT: ${{ needs.vars.outputs.environment }}
RANCHER_CLUSTERID: ${{ secrets.RANCHER_CLUSTERID_BASECMS }}
TRAVIS_REPO_SLUG: ${{ github.repository }}
TRAVIS_TAG: ${{ needs.vars.outputs.version }}
deploy:
needs: [vars, pre-deploy]
runs-on: ubuntu-latest
strategy:
matrix:
namespace:
- tauron-newsletters
tenant:
- all
- mundo
steps:
- uses: actions/checkout@v2
- name: Deploy to Kubernetes
run: npx @parameter1/base-cms-newsletter-deployment-tool deploy ${{ matrix.tenant }} ${{ matrix.namespace }}
env:
DOCKER_ORG: ${{ secrets.DOCKER_ORG }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
ENVIRONMENT: ${{ needs.vars.outputs.environment }}
RANCHER_CLUSTERID: ${{ secrets.RANCHER_CLUSTERID_BASECMS }}
RANCHER_TOKEN: ${{ secrets.RANCHER_TOKEN }}
RANCHER_URL: ${{ secrets.RANCHER_URL }}
TRAVIS_TAG: ${{ needs.vars.outputs.version }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TRAVIS_REPO_SLUG: ${{ github.repository }}
FORCE_DEPLOYMENT: 0
post-deploy-failure:
if: failure()
needs: [vars, deploy]
runs-on: ubuntu-latest
steps:
- name: Notify failure
run: npx @parameter1/base-cms-newsletter-deployment-tool notify-failed
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
ENVIRONMENT: ${{ needs.vars.outputs.environment }}
RANCHER_CLUSTERID: ${{ secrets.RANCHER_CLUSTERID_BASECMS }}
TRAVIS_REPO_SLUG: ${{ github.repository }}
TRAVIS_TAG: ${{ needs.vars.outputs.version }}
post-deploy-success:
if: success()
needs: [vars, deploy]
runs-on: ubuntu-latest
steps:
- name: Notify success
run: npx @parameter1/base-cms-newsletter-deployment-tool notify-finished
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
ENVIRONMENT: ${{ needs.vars.outputs.environment }}
RANCHER_CLUSTERID: ${{ secrets.RANCHER_CLUSTERID_BASECMS }}
TRAVIS_REPO_SLUG: ${{ github.repository }}
TRAVIS_TAG: ${{ needs.vars.outputs.version }}