Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Insert TraceID into Context and Response #59

Insert TraceID into Context and Response

Insert TraceID into Context and Response #59

Workflow file for this run

name: PR Deployment
run-name: Deploy PR-${{ github.event.pull_request.number }} to Testing Subdomain
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
packages: write
pull-requests: write
jobs:
start-comment:
uses: ./.github/workflows/comment-pr.yaml
if: github.actor != 'renovate[bot]' # Don't run this workflow for renovate bot
with:
message: |
:rocket: Your changes are being deployed to a preview domain.
secrets: inherit
preview-build-push-docker:
needs: start-comment
uses: ./.github/workflows/build-push-image.yaml

Check failure on line 30 in .github/workflows/pr-deploy.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/pr-deploy.yaml

Invalid workflow file

error parsing called workflow ".github/workflows/pr-deploy.yaml" -> "./.github/workflows/build-push-image.yaml" : secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
with:
preview: true
secrets: inherit
preview-deploy:
needs: preview-build-push-docker
uses: ./.github/workflows/deploy.yaml
with:
preview: true
docker-image: ${{ steps.meta.outputs.tags }}
compose-name: pr_${{ github.event.pull_request.number }}
ssh-script: |
cd ./preview/pr-${{ github.event.pull_request.number }}
cp ~/.env .env
mkdir -p ./deployments/keys
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> .env
echo "SERVER_IMAGE=ghcr.io/wwi21seb-projekt/server-alpha:pr-${{ github.event.pull_request.number }}" >> .env
echo "TRAFFIC_RULE=Host(\`pr-${{ github.event.pull_request.number }}.preview.server-alpha.tech\`)" >> .env
echo "MONITORING_TRAFFIC_RULE=Host(\`monitoring.pr-${{ github.event.pull_request.number }}.preview.server-alpha.tech\`)" >> .env
jq --arg pr_number "${{ github.event.pull_request.number }}" '
.panels[] |=
if .title == "Server-Alpha Logs" then .targets[0].expr = "{container_name=\"pr_" + $pr_number + "_app_1\"}"
elif .title == "Database Logs" then .targets[0].expr = "{container_name=\"pr_" + $pr_number + "_db_1\"}"
else . end
' deployments/provisioning/dashboards/logs.json > tmp.json && mv tmp.json deployments/provisioning/dashboards/logs.json
secrets: inherit
success-comment:
uses: ./.github/workflows/comment-pr.yaml
if: success()
with:
message: |
:white_check_mark: Your changes have been deployed to a preview domain.
You can access the preview at https://pr-${{ github.event.pull_request.number }}.preview.server-alpha.tech
:warning: Please note that the preview will be deleted once the pull request is closed.
secrets: inherit
failure-comment:
uses: ./.github/workflows/comment-pr.yaml
if: failure()
with:
message: |
:x: Your changes could not be deployed to a preview domain.
Please check the logs for more information.
secrets: inherit