| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- "on":
- workflow_dispatch:
- inputs:
- pr_branch_from:
- description: Pull request head branch
- required: true
- type: string
- pr_branch_into:
- description: Pull request base branch
- required: true
- type: string
- pr_number:
- description: Pull request number
- required: true
- type: string
- pr_title:
- description: Pull request title
- required: true
- type: string
- name: Porter Preview Environment
- jobs:
- porter-preview:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- id: checkout-code
- uses: actions/checkout@v3
- - name: Create Porter preview env
- id: preview
- timeout-minutes: 30
- uses: porter-dev/porter-preview-action@dev
- with:
- action_id: ${{ github.run_id }}
- cluster: "2489"
- host: https://dashboard.getporter.dev
- installation_id: "18533943"
- namespace: pr-${{ github.event.inputs.pr_number }}-porter
- pr_branch_from: ${{ github.event.inputs.pr_branch_from }}
- pr_branch_into: ${{ github.event.inputs.pr_branch_into }}
- pr_id: ${{ github.event.inputs.pr_number }}
- pr_name: ${{ github.event.inputs.pr_title }}
- project: "6680"
- repo_name: porter
- repo_owner: porter-dev
- token: ${{ secrets.PORTER_PREVIEW_6680_2489 }}
- - name: Attach vcluster
- run: |
- sudo apt-get update
- sudo apt-get install bash curl jq unzip
- /bin/bash -c "$(curl -fsSL https://install.porter.run)"
- echo "$VCLUSTER_KUBECONFIG" > /tmp/vcluster_kubeconfig
- dashboard_domain=$(echo "$DOMAINS" | jq '.subdomains[] | select(test("porter-dashboard*"))')
- dashboard_domain=$(sed -e 's/^"//' -e 's/"$//' <<<"$dashboard_domain")
- if [ -z "$dashboard_domain" ]; then
- exit 1
- fi
- export PORTER_HOST="https://${dashboard_domain}"
- porter connect kubeconfig --kubeconfig /tmp/vcluster_kubeconfig
- env:
- PORTER_TOKEN: ${{ secrets.PREVIEW_DEPLOYMENT_PORTER_KEY }}
- PORTER_PROJECT: 1
- VCLUSTER_KUBECONFIG: ${{ secrets.VCLUSTER_KUBECONFIG }}
- DOMAINS: ${{ steps.preview.outputs.domains }}
- concurrency:
- group: ${{ github.workflow }}-${{ github.event.inputs.pr_number }}
|