Why can't this just work? Seriously, it's not rocket science to make … #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to neocities | |
on: [workflow_dispatch, push] | |
concurrency: # prevent concurrent deploys doing strange things | |
group: deploy-to-neocities | |
cancel-in-progress: true | |
jobs: | |
# https://gist.github.com/AndrewLester/2d3e6257d932831756226ca9a281d9b5 | |
build_site: | |
runs-on: ubuntu-latest | |
if: ${{ contains(github.event.head_commit.message, '!UPD8') || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# If you're using pnpm, add this step then change the commands and cache key below to use `pnpm` | |
# - name: Install pnpm | |
# uses: pnpm/action-setup@v3 | |
# with: | |
# version: 8 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install dependencies | |
run: npm install | |
- name: build | |
env: | |
BASE_PATH: '/${{ github.event.repository.name }}' | |
run: | | |
npm run build | |
- name: Authenticate | |
uses: oleksiyrudenko/gha-git-credentials@v2-latest | |
with: | |
token: '${{ secrets.GITHUB_TOKEN }}' | |
- name: Commit changes | |
run: | | |
git add -A | |
git commit -m "Automatically build site" | |
git push | |
# deploy: | |
# needs: build_site | |
# runs-on: ubuntu-latest | |
# if: ${{ contains(github.event.head_commit.message, '!UPD8') || github.event_name == 'workflow_dispatch' }} | |
# steps: | |
- name: Deploy to neocities | |
if: ${{ success() || failure() }} | |
uses: bcomnes/deploy-to-neocities@v1.1.9 | |
with: | |
api_token: ${{ secrets.NEOCITIES_API_TOKEN }} | |
cleanup: false | |
dist_dir: public |