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

Simplify website deployment workflows #1404

Merged
merged 6 commits into from
May 16, 2024
Merged

Conversation

brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented May 15, 2024

What is this PR doing?

This PR simplifies website deployment workflows.

What problem is it solving?

Now that we are pushing built website files directly to WP Cloud, there is no longer any need to run deployment as a two-workflow process. It means we can just push the build directly rather than having to save it as a build artifact that is downloaded by the next workflow.

How is the problem addressed?

This PR merges the relevant steps from the second workflow into the first and deletes a lot of unnecessary code.

Testing Instructions

Test via workflow instrumentation and temporary changes to deploy to a staging site:
https://wordpress-playground-staging.atomicsites.blog

@brandonpayton brandonpayton force-pushed the single-website-deploy-workflow branch from 355d77a to eec2cd7 Compare May 15, 2024 21:23
@brandonpayton brandonpayton had a problem deploying to playground-wordpress-net-wp-cloud May 15, 2024 21:25 — with GitHub Actions Failure
@brandonpayton brandonpayton had a problem deploying to playground-wordpress-net-wp-cloud May 15, 2024 21:35 — with GitHub Actions Failure
@brandonpayton brandonpayton had a problem deploying to playground-wordpress-net-wp-cloud May 15, 2024 21:46 — with GitHub Actions Failure
@brandonpayton brandonpayton had a problem deploying to playground-wordpress-net-wp-cloud May 15, 2024 23:13 — with GitHub Actions Failure
@brandonpayton brandonpayton had a problem deploying to playground-wordpress-net-wp-cloud May 15, 2024 23:27 — with GitHub Actions Failure
@brandonpayton brandonpayton temporarily deployed to playground-wordpress-net-wp-cloud May 15, 2024 23:39 — with GitHub Actions Inactive
@brandonpayton
Copy link
Member Author

There were some SSH and pathing errors, but those are fixed now.

This update was used to deploy to a staging site:
https://wordpress-playground-staging.atomicsites.blog/

This is ready for review.

@@ -6,6 +6,11 @@ on:
schedule:
- cron: '0 9,18 * * *'

concurrency:
group: website-deployment
Copy link
Member Author

Choose a reason for hiding this comment

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

This ensures that only one website deployment workflow can run at a time.

@brandonpayton brandonpayton marked this pull request as ready for review May 15, 2024 23:59
Copy link
Collaborator

@bgrgicak bgrgicak left a comment

Choose a reason for hiding this comment

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

The code looks good to me, but I didn't run the workflow.

@@ -6,6 +6,11 @@ on:
schedule:
- cron: '0 9,18 * * *'

concurrency:
group: website-deployment
# TODO: Enable cancel-in-progress once we are deploying per commit?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd let it finish – stopping the deployment halfway through or when the apply-update.sh is running sounds like trouble. If we push 5 commits in rapid progression, though, perhaps this could only run for the first and the fifth, but not for anything in between?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd let it finish – stopping the deployment halfway through or when the apply-update.sh is running sounds like trouble.

Good point.

If we push 5 commits in rapid progression, though, perhaps this could only run for the first and the fifth, but not for anything in between?

That's my understanding: There can be one workflow instance active and one pending. If another becomes pending, it replaces the previous pending workflow.

@adamziel adamziel merged commit e2f3285 into trunk May 16, 2024
5 checks passed
@adamziel adamziel deleted the single-website-deploy-workflow branch May 16, 2024 08:03
@StevenDufresne
Copy link
Contributor

Noting that this PR has put documentation out of sync:
https://wordpress.github.io/wordpress-playground/architecture/host-your-own-playground#download-pre-built-package.

How do users download pre-built artifacts to self-host?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants