From a2d67043267d885050434d297d3dd3a3a14fd899 Mon Sep 17 00:00:00 2001 From: Kitty Chiu <42864823+KittyChiu@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:59:05 +1100 Subject: [PATCH 1/2] doc: updated usage section in readme --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 835887a..d4f52ac 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,59 @@ A composite Action for packaging and uploading artifact that can be deployed to ## Usage -See [action.yml](action.yml) +See [action.yml](action.yml) for the various `inputs` this action supports (or [below](#inputs-📥)). + +We recommend this action to be used in the build job: + +```yaml +jobs: + # Build job + build: + + # Specify runner + build & upload the static files as an artifact + runs-on: ubuntu-latest + steps: + - name: Build static files + id: build + run: | + # + # At a minimum this step should build the static files of your site + # + + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action + with: + path: build_outputs_folder/ + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + +``` + +### Inputs 📥 + +| Input | Required? | Default | Description | +| ---------------- | --------- | ----------------------- | -------------------------------------------------- | +| `name` | `false` | `github-pages` | Artifact name | +| `path` | `true` | `_site/` | Path of the directory containing the static assets | +| `retention-days` | `false` | `1` | Duration after which artifact will expire in days | + +### Outputs 📤 + +| Output | Description | +| ------------- | ---------------------------------------- | +| `artifact_id` | The ID of the artifact that was uploaded | - ## Artifact validation From e59cdfe6d6b061aab8f0619e759cded914f3ab03 Mon Sep 17 00:00:00 2001 From: Kitty Chiu <42864823+KittyChiu@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:09:29 +1100 Subject: [PATCH 2/2] Update README.md Co-authored-by: Yoann Chaudet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4f52ac..1ddf898 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A composite Action for packaging and uploading artifact that can be deployed to See [action.yml](action.yml) for the various `inputs` this action supports (or [below](#inputs-📥)). -We recommend this action to be used in the build job: +If you breakdown your workflow in two jobs (`build` and `deploy`), we recommend this action to be used in your `build` job: ```yaml jobs: