Skip to content

Update insertion.md #57

Update insertion.md

Update insertion.md #57

Workflow file for this run

name: Staging deployment
on:
push:
branches:
- staging
env:
DEPLOYMENT: datafresq
DEPLOYMENT_NAMESPACE: datafresq
DEPLOYMENT_URL: https://datafresq.staging.dataesr.ovh
MM_NOTIFICATION_CHANNEL: bots
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish-ghcr:
name: Publish docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: 🏁 Checkout
uses: actions/checkout@v6
- name: 🏷️ Get tag
id: version
run: echo "tag=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: 🔑 Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏷️ Extract metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix={{branch}}-
- name: 🐋 Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
name: Update staging deployment
runs-on: ubuntu-latest
needs: publish-ghcr
steps:
- name: Deploy to Cluster
id: kubectl-deploy
uses: dataesr/kubectl-deploy@v1.1
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DOAD_STAGING }}
with:
namespace: ${{ env.DEPLOYMENT_NAMESPACE }}
restart: ${{ env.DEPLOYMENT }}
notify:
name: Notify
needs: deploy
if: always()
runs-on: ubuntu-latest
steps:
- uses: dataesr/mm-notifier-action@v1.0.3
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}}
deployment_url: ${{ env.DEPLOYMENT_URL }}