From 2c55e52d4ef38f7ff874b0d61cdddfdedb6691d2 Mon Sep 17 00:00:00 2001 From: fergus rooney Date: Fri, 23 Jun 2023 17:45:26 +0100 Subject: [PATCH] Add a more detailed usage example, referring to issue #6 --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 07a01f7..1d9fd96 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,37 @@ A composite Action for packaging and uploading artifact that can be deployed to ⚠️ Official support for building Pages with Actions is in public beta at the moment. # Usage +As an example you may want to build your page as a pages artifact so you can publish it using [actions/deploy-pages](https://github.com/actions/deploy-pages). This actions completes steps 1-4 from [this tutorial](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#creating-a-custom-github-actions-workflow-to-publish-your-site) -See [action.yml](action.yml) +``` +name: Build Page + Upload artifact +on: + push: + branches: + - main + +jobs: + build-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + # Replace this step your own page build process + - name: Build your page + run: | + cd docs/ + make html + + # Change path to link include index of your webpage + - name: Upload your page as github pages artifact + uses: actions/upload-pages-artifact@main + with: + path: docs/build/html/ +``` +After you have uploaded the pages artifact, you can add another job that deploys the artifact using the [actions/deploy-pages](https://github.com/actions/deploy-pages) action + +See [action.yml](action.yml) for the full parameters (This is the action itself not an example)