diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8fba7959..4eecad77 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -16,14 +16,27 @@ jobs: # pull from custom Hugo Extended image with opinionated changes # Docker hub: https://hub.docker.com/r/jakejarvis/hugo-custom # base Dockerfile source: https://go.jarv.is/hugo-dockerfile - - uses: docker://jakejarvis/hugo-custom:latest + - name: Build Hugo + uses: docker://jakejarvis/hugo-custom:latest with: args: --gc --cleanDestinationDir - - uses: jakejarvis/github-pages-deploy-action@master - env: - PAGES_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }} - PAGES_CNAME: 'jarv.is' - PAGES_SOURCE_FOLDER: 'public' - PAGES_SOURCE_BRANCH: 'master' - PAGES_TARGET_BRANCH: 'master' - PAGES_TARGET_REPO: 'jakejarvis.github.io' + # native git commands for speed and simplicity, and because this + # setup is a weird edge case not worth making an action for. + - name: Push to jakejarvis.github.io + shell: bash + run: | + # copy Hugo output to somewhere we have permissions + mkdir gh-pages + cp -r public/* gh-pages + cd gh-pages + # CNAME file for GitHub Pages custom domain + echo "jarv.is" > CNAME + # set up git + git init + git config user.name "Jake Jarvis" + git config user.email "jakejarvis@users.noreply.github.com" + # deploy folder to external *.github.io repository + git remote add target https://${{ secrets.GITHUB_ACCESS_TOKEN }}@github.com/jakejarvis/jakejarvis.github.io.git + git add -A + git commit -m "GitHub Pages deploy from $GITHUB_REPOSITORY@$GITHUB_SHA" + git push --force target master