Skip to content

Commit

Permalink
packaging updates for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Aug 9, 2024
1 parent 7fccd63 commit 188b448
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: ACTIONS_ALLOW_UNSECURE_COMMANDS
id: ACTIONS_ALLOW_UNSECURE_COMMANDS
run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV

- name: set env variable actor
run: echo 'GITHUB_ACTOR=$GITHUB_ACTOR' >> $GITHUB_ENV

- name: set env variable repo
run: echo 'GITHUB_REPOSITORY=$GITHUB_REPOSITORY' >> $GITHUB_ENV

- name: Checkout 🛎️
uses: actions/checkout@v4.1.7 # 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

- name: Read CNAME
id: cname
uses: juliangruber/read-file-action@v1
with:
path: ./CNAME
- name: set env variable CNAME
run: echo 'CNAME=${{ steps.cname.outputs.content }}' >> $GITHUB_ENV
- 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 run ghpages:build
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.6.3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: $GITHUB_BASE_REF # The branch the action should deploy to.
FOLDER: ./ # The folder the action should deploy.
Empty file added .nojekyll
Empty file.
1 change: 1 addition & 0 deletions build
17 changes: 17 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[headers]]
for = "/*"
[headers.values]
Cache-Control = "max-age=31536001"
Cross-Origin-Opener-Policy = "same-origin"
Cross-Origin-Embedder-Policy = "require-corp"


[[headers]]
for = "/"
[headers.values]
Cache-Control = "no-cache"

[[headers]]
for = "/*.html"
[headers.values]
Cache-Control = "no-cache"
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"@haxtheweb/haxcms-nodejs": "^9.0.5"
},
"scripts": {
"start": "npx @haxtheweb/haxcms-nodejs",
"dev-theme": "cd custom && yarn start"
"start": "npm run dev",
"ghpages:build": "rm dist && rm assets/babel* && rm build && rm node_modules && rm wc-registry.json",
"dev": "npx @haxtheweb/haxcms-nodejs",
"dev-theme": "cd custom && npm start"
}
}
1 change: 1 addition & 0 deletions wc-registry.json

0 comments on commit 188b448

Please sign in to comment.