Preview the application #121
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: Preview the application | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, closed] | |
# This will cancel the previous running jobs if a new commit is added to the PR | |
concurrency: | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy-preview: | |
uses: ./.github/workflows/deploy-preview.yaml | |
with: | |
app_name: workflows | |
service_type: webservice | |
port: 3000 | |
aws_role: arn:aws:iam::387308402250:role/github_actions_kubernetes_deployment_development | |
fargate: false | |
secrets: | |
github_app_private_key: ${{ secrets.DIGNIO_GH_APP_PRIVATE_KEY }} | |
check-outputs: | |
name: Check outputs from deploy preview | |
needs: deploy-preview | |
if: github.event.action != 'closed' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo preview URL | |
shell: bash | |
run: | | |
[ -z "${{ needs.deploy-preview.outputs.preview_url }}" ] && exit 1 || echo "${{ needs.deploy-preview.outputs.preview_url }}" |