adding pull preview - Don't merge these changes #16
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: PullPreview | |
on: | |
pull_request: | |
types: [ labeled, unlabeled, synchronize, closed, reopened ] | |
jobs: | |
setup: | |
uses: communitiesuk/funding-service-design-workflows/.github/workflows/determine-jobs.yml@main | |
with: | |
environment: ${{ inputs.environment }} | |
paketo_build: | |
needs: [ setup ] | |
permissions: | |
packages: write | |
uses: communitiesuk/funding-service-design-workflows/.github/workflows/package.yml@main | |
with: | |
version_to_build: sha-${{ github.sha }} | |
owner: ${{ github.repository_owner }} | |
application: funding-service-design-fund-application-builder | |
assets_required: false | |
deploy: | |
needs: [ setup, paketo_build ] | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
deployments: write # to delete deployments | |
pull-requests: write # to remove labels | |
statuses: write # to create commit status | |
id-token: write # This is required for AWS credentials | |
name: deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
environment: 'dev' | |
steps: | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/GithubCopilotDeploy | |
role-session-name: FUNDING_SERVICE_DESIGN_FUND_APPLICATION_BUILDER_PULLPREVIEW | |
aws-region: eu-west-2 | |
- uses: actions/checkout@v2 | |
- name: Inject env specific values into docker compose | |
run: | | |
yq -i 'services.fab.image = "ghcr.io/communitiesuk/funding-service-design-fund-application-builder:sha-${{ github.sha }}"' docker-compose.pullpreview.yml | |
- uses: pullpreview/[email protected] | |
with: | |
compose_files: docker-compose.pullpreview.yml | |
ports: 8080/tcp | |
default_port: 8080 | |
admins: gidsg |