Deploy cloudflare-exporter to stage #23
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: "Deploy cloudflare-exporter to stage" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
PROJECT_NAME: cloudflare-exporter | |
TEAM: csi | |
APP_ENV: stage | |
NAMESPACE: infra | |
HELM_CHART: "deployment" | |
HELM_CHART_MAJOR_VERSION: "1" | |
PABLO_VERSION: "v2" | |
GITHUB_SHA: ${{ github.sha }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MOS_EU_GITHUB_TOKEN: ${{ secrets.MOS_EU_GITHUB_TOKEN }} | |
MOS_EU_GITHUB_USERNAME: ${{ secrets.MOS_EU_GITHUB_USERNAME }} | |
SLACK_TOKEN: ${{ secrets.PABLO_SLACK_TOKEN }} | |
GKE_KEY: ${{ secrets.GKE_DEVELOP_KEY }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Checking out Pablo | |
uses: actions/checkout@v2 | |
with: | |
repository: MyOnlineStore/pablo | |
ref: ${{ env.PABLO_VERSION }} | |
token: ${{ secrets.MOS_EU_GITHUB_TOKEN }} | |
path: .github/actions/pablo | |
# Setup gcloud CLI | |
- name: Setup gcloud CLI | |
uses: google-github-actions/setup-gcloud@v1 | |
# Build and push the Docker image | |
- name: Build and Push Image | |
id: dockerBuild | |
uses: ./.github/actions/pablo | |
with: | |
command: docker.build-and-push | |
outputs: | |
imageHash: ${{ steps.dockerBuild.outputs.imageHash }} | |
imageTag: ${{ steps.dockerBuild.outputs.imageTag }} | |
deploy: | |
name: Deploy | |
runs-on: self-hosted | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Checking out Pablo | |
uses: actions/checkout@v2 | |
with: | |
repository: MyOnlineStore/pablo | |
ref: ${{ env.PABLO_VERSION }} | |
token: ${{ secrets.MOS_EU_GITHUB_TOKEN }} | |
path: .github/actions/pablo | |
# Deploy | |
- name: Deploy | |
uses: ./.github/actions/pablo | |
with: | |
command: kubernetes.rolling-deployment | |
helmChart: ${{ env.HELM_CHART }} | |
helmChartVersion: ${{ env.HELM_CHART_MAJOR_VERSION }} | |
imageHash: ${{ needs.build.outputs.imageHash }} | |
imageTag: ${{ needs.build.outputs.imageTag }} | |
notify: | |
name: Notify | |
runs-on: self-hosted | |
if: success() || failure() | |
needs: | |
- build | |
- deploy | |
steps: | |
- name: Checking out Pablo | |
uses: actions/checkout@v2 | |
with: | |
repository: MyOnlineStore/pablo | |
ref: ${{ env.PABLO_VERSION }} | |
token: ${{ secrets.MOS_EU_GITHUB_TOKEN }} | |
path: .github/actions/pablo | |
- name: Notify slack | |
uses: ./.github/actions/pablo | |
with: | |
command: slack.notify-complete | |
status: ${{ needs.build.result }},${{ needs.deploy.result }} | |