This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
Production Deployment #230
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: Production Deployment | |
on: | |
workflow_dispatch: | |
inputs: | |
imageTag: | |
description: "Image tag to deploy (see https://github.com/digitalservicebund/grundsteuer/pkgs/container/grundsteuer/versions)" | |
required: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
deploy-production: | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Check out infra repo | |
uses: actions/checkout@v3 | |
with: | |
repository: digitalservicebund/grundsteuer-infra | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Update image tag for production | |
run: | | |
cd manifests/overlays/production | |
kustomize edit set image ghcr.io/digitalservicebund/grundsteuer:${{ github.event.inputs.imageTag }} | |
- name: Commit and push | |
uses: EndBug/add-and-commit@61a88be553afe4206585b31aa72387c64295d08b | |
with: | |
add: "manifests/overlays/production/kustomization.yaml" | |
message: "Update production image to ${{ github.event.inputs.imageTag }}" | |
pathspec_error_handling: exitImmediately | |
push: true | |
- name: Register deployment with Sentry | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: | | |
npx --package @sentry/cli --yes sentry-cli releases deploys --org digitalservice --project grundsteuer ${{ github.event.inputs.imageTag }} new -e production | |
- name: Report Deployment | |
uses: satak/webrequest-action@283a84a8a140f4ddd8f7df4ef676c45c1f590933 | |
with: | |
url: ${{ secrets.METRICS_DEPLOYMENT_WEBHOOK_URL }} | |
method: POST | |
payload: '{"project": "grundsteuer", "version_identifier": "${{ github.sha }}", "environment": "production", "link": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' | |
headers: '{"Authorization": "Token ${{ secrets.METRICS_WEBHOOK_TOKEN }}"}' |