mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 07:26:20 +00:00
### Summary - signoz package with goreleaser - frontend deprecation - alertmanager deprecation --------- Signed-off-by: Prashant Shahi <prashant@signoz.io>
56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
name: testing-deployment
|
|
# Trigger deployment only on testing-deploy label on pull request
|
|
on:
|
|
pull_request:
|
|
types: [labeled]
|
|
jobs:
|
|
deploy:
|
|
name: Deploy PR branch to testing
|
|
runs-on: ubuntu-latest
|
|
environment: testing
|
|
if: ${{ github.event.label.name == 'testing-deploy' }}
|
|
permissions:
|
|
contents: 'read'
|
|
id-token: 'write'
|
|
steps:
|
|
- id: 'auth'
|
|
uses: 'google-github-actions/auth@v2'
|
|
with:
|
|
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
|
|
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
|
|
|
|
- name: 'sdk'
|
|
uses: 'google-github-actions/setup-gcloud@v2'
|
|
|
|
- name: 'ssh'
|
|
shell: bash
|
|
env:
|
|
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
GITHUB_SHA: ${{ github.sha }}
|
|
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
|
|
GCP_ZONE: ${{ secrets.GCP_ZONE }}
|
|
GCP_INSTANCE: ${{ secrets.GCP_INSTANCE }}
|
|
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
|
|
run: |
|
|
read -r -d '' COMMAND <<EOF || true
|
|
echo "GITHUB_BRANCH: ${GITHUB_BRANCH}"
|
|
echo "GITHUB_SHA: ${GITHUB_SHA}"
|
|
export DOCKER_TAG="${GITHUB_SHA:0:7}" # needed for child process to access it
|
|
export DEV_BUILD="1"
|
|
export PATH="/usr/local/go/bin/:$PATH" # needed for Golang to work
|
|
docker system prune --force
|
|
cd ~/signoz
|
|
git status
|
|
git add .
|
|
git stash push -m "stashed on $(date --iso-8601=seconds)"
|
|
git fetch origin
|
|
git checkout main
|
|
git pull
|
|
# This is added to include the scenerio when new commit in PR is force-pushed
|
|
git branch -D ${GITHUB_BRANCH}
|
|
git checkout --track origin/${GITHUB_BRANCH}
|
|
make build-signoz-amd64
|
|
make run-testing
|
|
EOF
|
|
gcloud beta compute ssh ${GCP_INSTANCE} --zone ${GCP_ZONE} --ssh-key-expire-after=15m --tunnel-through-iap --project ${GCP_PROJECT} --command "${COMMAND}"
|