Skip to content

Commit

Permalink
Trial setup of PR Previews
Browse files Browse the repository at this point in the history
  • Loading branch information
omad committed Mar 13, 2024
1 parent cd728d9 commit 0aa4693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/deploy-pr-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
PR_PREVIEW_SUBDOMAIN: pr-${{github.event.pull_request.number}}-preview
DEPLOY_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PR_PREVIEW_BUCKET: s3://khpreview.dea.ga.gov.au

jobs:
publish:
Expand Down Expand Up @@ -48,7 +49,7 @@ jobs:
- name: Configure AWS credentials via OIDC
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-docs
role-to-assume: arn:aws:iam::538673716275:role/github-actions-dea-knowledge-hub-prs
aws-region: ap-southeast-2

- name: "Comment on PR: Preview is building"
Expand All @@ -64,10 +65,8 @@ jobs:
| **Deploy log:** | [View the log]($DEPLOY_LOG_URL) |
- name: Deploy site
env:
DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }}
DEST_DIR: $PR_PREVIEW_SUBDOMAIN
run: ./deploy-pr-preview.sh
run: |
aws s3 sync --delete output "$PR_PREVIEW_BUCKET/$PR_PREVIEW_SUBDOMAIN"
- name: "Update Comment on PR: Preview is ready"
id: comment-preview-ready
Expand All @@ -80,6 +79,6 @@ jobs:
| <!-- --> | <!-- --> |
| --- | --- |
| **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.knowledge.dea.ga.gov.au/) |
| **Preview site:** | [$PR_PREVIEW_SUBDOMAIN.khpreview.dea.ga.gov.au](https://$PR_PREVIEW_SUBDOMAIN.khpreview.dea.ga.gov.au/) |
| **Deploy log:** | [View the log]($DEPLOY_LOG_URL) |
7 changes: 0 additions & 7 deletions deploy-pr-preview.sh

This file was deleted.

0 comments on commit 0aa4693

Please sign in to comment.