From 31dbea4cd23525b7561b802c743c88d60a0606a4 Mon Sep 17 00:00:00 2001 From: Baris Tosun Date: Wed, 31 Jan 2024 16:09:05 +0100 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2ca448..377b9b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,3 +51,34 @@ jobs: with: name: site path: _site +# Now we can deploy the site to GitHub Pages! +deploy: + runs-on: ubuntu-latest + needs: build # Run the build job first, otherwise we won't have anything to deploy + + steps: + - uses: actions/checkout@v3 + with: + ref: 'gh-pages' # Checkout the gh-pages branch + + # (optional) Remove any old files from the gh-pages branch + - name: Empty site directory + run: rm -rf * + + # Download the compiled site into the current directory + - name: Download site artifact + uses: actions/download-artifact@v3 + with: + name: site + path: '.' + + # Create a .nojekyll file to prevent GitHub from attempting to compile a Jekyll site + - name: Create .nojekyll file + run: touch .nojekyll + + # Commit the changes to the gh-pages branch + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + add: '.' + message: 'Upload compiled site ${{ github.sha }}'