Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated GitHub Actions workflow to update dev / prod QML sites on merge #498

Merged
merged 2 commits into from
May 26, 2022
Merged

Conversation

rashidnhm
Copy link
Collaborator

Title: Updated GitHub Actions workflow to update dev / prod QML sites on merge

Summary:
This PR introduces the changes missed in the previous iteration of the actions docs build workflow. On merge to either master/dev, the built docs will now be pushed to the appropriate S3 bucket.

Note: There is a terraform change that needs to be applied before this PR can be merged.

Relevant references:
sc-20104

Possible Drawbacks:
N/A

Related GitHub Issues:
N/A

@rashidnhm rashidnhm added the bug Something isn't working label May 26, 2022
@rashidnhm rashidnhm requested a review from josh146 May 26, 2022 04:42
@rashidnhm rashidnhm self-assigned this May 26, 2022
@github-actions
Copy link

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

  • Pull Request ID: 498
  • Deployment SHA: 75aeffbee6b17d4a895b5607b1a7b7e4200ccbd4
    (The Deployment SHA refers to the latest commit hash the docs were built from)

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this fixed so quickly @rashidnhm :)

@@ -10,7 +10,7 @@ env:
NUM_WORKERS: 15

concurrency:
group: ${{ github.ref }}
group: build-docs-${{ github.ref }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this change mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency allows you to control multiple runs of the same workflow against some label ... I added the build-docs- just to make the name a bit more clear

@@ -141,7 +141,9 @@ jobs:
uses: actions/cache@v3
with:
path: demos
key: gallery-${{ hashFiles('matrix_info.txt') }}-${{ github.ref_name }}
key: gallery-${{ hashFiles('matrix_info.txt') }}-${{ github.ref_name }}-${{ github.sha }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious how come the SHA was added?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra failsafe, with the sha as part of the key each build is stored in a different key, the restore key is still present with the older key to match the most recent cache

@@ -181,7 +183,7 @@ jobs:
--verbose

- name: Upload Html
if: github.event_name == 'pull_request' && matrix.offset == 0
if: matrix.offset == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

run: |
echo "Got actions Bucket ID: ${{ env.BUCKET_ACTIONS_ID }}"
AWS_BUCKET_NAME=${{ secrets[env.BUCKET_ACTIONS_ID] }}
aws s3 sync website s3://$AWS_BUCKET_NAME/qml/ --delete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, website is the folder containing the latest master build (generated using the latest cache)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the content inside website is equal to the content you would see inside _build/html/

@rashidnhm rashidnhm merged commit 9816a6d into PennyLaneAI:master May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants