Skip to content

Conversation

@OmarAglan
Copy link

@OmarAglan OmarAglan commented May 23, 2025

This pull request enhances the CI workflow by introducing functionality to manage and deploy build artifacts to GitHub Pages. The most significant changes include adding permissions for pages and id-token, creating a new job to prepare GitHub Pages content, and adding a deployment job for publishing to GitHub Pages. This happens only if there is a successful build, and only on the last commit on main. This makes it faster for others to test this by downloading the built artifact.

Permissions Updates:

  • Added pages: write and id-token: write permissions to the workflow to enable artifact management and deployment to GitHub Pages. (.github/workflows/ci.yml, .github/workflows/ci.ymlR6-R7)

New GitHub Pages Workflow:

  • Introduced a prepare-gh-pages job that:
    • Downloads workflow artifacts and organizes them into a historical structure.
    • Generates an index.html file listing historical builds and their artifacts.
    • Cleans up old builds, retaining only the five most recent builds. (.github/workflows/ci.yml, .github/workflows/ci.ymlR140-R277)
  • Added a deploy-gh-pages job to publish the prepared content to GitHub Pages, ensuring the latest artifacts are accessible. (.github/workflows/ci.yml, .github/workflows/ci.ymlR140-R277)

for example, on my repo, the website looks like this:
https://omardev.engineer/GeneralsGameCode/

Targets issue #886

@xezon xezon requested a review from tintinhamans May 23, 2025 20:23
@OmarAglan OmarAglan force-pushed the upload-artifacts branch 2 times, most recently from 73f803f to 24ddfd2 Compare May 24, 2025 20:55
@OmarAglan
Copy link
Author

Updated To only Keep 5 artifact, so the storage doesn't get overwhelmed.

@OmarAglan OmarAglan requested a review from Skyaero42 May 24, 2025 21:00
@OmarAglan
Copy link
Author

Closing as looks like #929 is better method of doing this.

@OmarAglan OmarAglan closed this Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants