From 00910a99dbd80474d66697206aae9d33f1e9d1d8 Mon Sep 17 00:00:00 2001 From: James Ives Date: Wed, 3 Feb 2021 23:21:53 -0500 Subject: [PATCH] Update README.md --- README.md | 63 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7f9d1df6..9ed6db96 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. - with: - persist-credentials: false + uses: actions/checkout@v2.3.1 - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. run: | @@ -62,7 +60,7 @@ jobs: npm run build - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@4.0.0 with: branch: gh-pages # The branch the action should deploy to. folder: build # The folder the action should deploy. @@ -180,7 +178,7 @@ With this configured you can then set the `ssh-key` part of the action to your p ```yml - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@4.0.0 with: branch: gh-pages folder: site @@ -202,8 +200,6 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v2 - with: - persist-credentials: false - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. run: | @@ -211,7 +207,7 @@ jobs: npm run build - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@4.0.0 with: branch: gh-pages folder: build @@ -253,8 +249,6 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v2 - with: - persist-credentials: false - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. run: | @@ -273,8 +267,6 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v2 - with: - persist-credentials: false - name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder. uses: actions/download-artifact@v1 @@ -282,7 +274,7 @@ jobs: name: site - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@4.0.0 with: token: ${{ secrets.ACCESS_TOKEN }} branch: gh-pages @@ -304,25 +296,54 @@ If you use a [container](https://help.github.com/en/actions/automating-your-work apt-get update && apt-get install -y rsync - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@4.0.0 ``` --- ### Additional Build Files 📁 -If you're using a custom domain and require a `CNAME` file, or if you require the use of a `.nojekyll` file, you can safely commit these files directly into deployment branch without them being overridden after each deployment. Additionally you can include these files in your deployment folder to update them. +If you're using a custom domain and require a `CNAME` file, or if you require the use of a `.nojekyll` file, you can safely commit these files directly into deployment branch without them being overridden after each deployment, additionally you can include these files in your deployment folder to update them. If you need to add additional files to the deployment that should be ignored by the build clean-up steps you can utilize the `clean-exclude` option. + + +
Click here to view an exmaple of this. +

+ +```yml +name: Build and Deploy +on: + push: + branches: + - master +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 + + - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. + run: | + npm install + npm run build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.0.0 + with: + branch: gh-pages + folder: build + clean: true + clean-exclude: | + special-file.txt + some/*.txt +``` +

+
If you wish to remove these files you must go into the deployment branch directly to remove them. This is to prevent accidental changes in your deployment script from creating breaking changes. --- -### Debugging 🐝 - -If you'd like to enable action debugging you can set the `ACTIONS_STEP_DEBUG` environment variable to true within the [Settings/Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets) menu. If you're using this action in your own project as a node module via yarn or npm **you may expose your secrets if you toggle this on in a production environment**. You can learn more about debugging GitHub actions [here](https://github.com/actions/toolkit/blob/master/docs/action-debugging.md). - ---- - ## Support 💖 This project would not be possible without all of our fantastic [contributors](https://github.com/JamesIves/github-pages-deploy-action/graphs/contributors).