Skip to content

Commit

Permalink
change release to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
teawaterwire committed Sep 4, 2023
1 parent b366879 commit cac2b0b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: ["master"]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install deps
run: npm install

- name: Build artifact
run: npm run release

- name: Upload artifact
uses: actions/[email protected]
with:
path: resources/public

deploy:
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ this repository is meant to be used as a starter kit for those willing to try we

## install

1. `git clone [email protected]:teawaterwire/web4th.git && cd web4th`
1. click the button "Use this template" above, or `git clone [email protected]:teawaterwire/web4th.git && cd web4th`

2. `npm install`

Expand Down Expand Up @@ -176,19 +176,11 @@ _(you can register your own app account the same way you registered the support

## release

using [Cloudflare Pages](https://pages.cloudflare.com/) it's as simple as connecting your GitHub repository and adding these settings:
this repository comes with a GitHub workflow that builds and deploys to Github Pages

> Framework preset: `None`
>
> build command: `npm run release`
>
> Build output directory: `/resources/public`
>
> Root directory: `/`
>
> Environment variables: `NODE_VERSION` = 16
this can be triggered manually or on every push to the `master` branch

choose "Build system version 1", click "Save and Deploy" and voilà 💫
_(you either need your repository to be public or have a paid account)_

## style

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"cssnano": "^5.1.9",
"npm-run-all": "^4.1.5",
"postcss-cli": "^9.1.0",
"shadow-cljs": "^2.18.0",
"shadow-cljs": "2.25.2",
"tailwindcss": "^3.0.24"
},
"dependencies": {
Expand Down

0 comments on commit cac2b0b

Please sign in to comment.