The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/.github/workflows/ephemeral-instances-pr-comm...

62 lines
2.3 KiB

name: 'Ephemeral instances'
on:
issue_comment:
types: [created]
pull_request:
types: [closed]
jobs:
config:
runs-on: "ubuntu-latest"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
- name: "Check for secrets"
id: check
shell: bash
run: |
if [ -n "${{ (secrets.EI_APP_ID != '' &&
secrets.EI_APP_PRIVATE_KEY != '' &&
secrets.EI_GCOM_HOST != '' &&
secrets.EI_GCOM_TOKEN != '' &&
secrets.EI_EPHEMERAL_INSTANCES_REGISTRY != '' &&
secrets.EI_GCP_SERVICE_ACCOUNT_KEY_BASE64 != '' &&
secrets.EI_EPHEMERAL_ORG_ID != ''
) || '' }}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi
handle-pull-request-event:
needs: config
if: needs.config.outputs.has-secrets &&
${{ github.event.issue.pull_request && (startsWith(github.event.comment.body, '/deploy-to-hg') || github.event.action == 'closed') }}
runs-on:
labels: ubuntu-latest-8-cores
continue-on-error: true
steps:
- name: Generate a GitHub app installation token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.EI_APP_ID }}
private_key: ${{ secrets.EI_APP_PRIVATE_KEY }}
- name: Checkout ephemeral instances repository
uses: actions/checkout@v4
with:
repository: grafana/ephemeral-grafana-instances-github-action
token: ${{ steps.generate_token.outputs.token }}
ref: main
path: ephemeral
persist-credentials: false
- name: build and deploy ephemeral instance
uses: ./ephemeral
with:
github-token: ${{ steps.generate_token.outputs.token }}
gcom-host: ${{ secrets.EI_GCOM_HOST }}
gcom-token: ${{ secrets.EI_GCOM_TOKEN }}
registry: "${{ secrets.EI_EPHEMERAL_INSTANCES_REGISTRY }}"
gcp-service-account-key: "${{ secrets.EI_GCP_SERVICE_ACCOUNT_KEY_BASE64 }}"
ephemeral-org-id: "${{ secrets.EI_EPHEMERAL_ORG_ID }}"
oss-or-enterprise: oss
verbose: true