Skip to content

Commit

Permalink
Add workflow to publish pages
Browse files Browse the repository at this point in the history
  • Loading branch information
iansan5653 authored Sep 8, 2023
1 parent 45ded83 commit 7b36f39
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- master
pull_request:

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

- uses: actions/setup-node@v3
with:
node-version: 12.x

- run: npm install

- run: npm run build

- name: Fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- uses: actions/upload-pages-artifact@v2

deploy:
needs: build

permissions:
pages: write
id-token: write

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

runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v2
3 changes: 1 addition & 2 deletions examples/demo.html → pages/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
<a href="#ok" data-hotkey="o k">Press <kbd>o k</kbd> click this link</a>

<script type="module">
// import {install} from '../dist/index.js'
import {install} from 'https://unpkg.com/@github/hotkey@latest?module'
import {install} from '../dist/index.js'

for (const el of document.querySelectorAll('[data-hotkey]')) {
install(el)
Expand Down
3 changes: 1 addition & 2 deletions examples/hotkey_mapper.html → pages/hotkey_mapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ <h1 id="app-name">Hotkey Code</h1>
</div>

<script type="module">
// import {eventToHotkeyString} from '../dist/index.js'
import {eventToHotkeyString} from 'https://unpkg.com/@github/hotkey@latest?module'
import {eventToHotkeyString} from '../dist/index.js'

document.getElementById('hotkey-code').addEventListener('keydown', event => {
if (event.key === "Tab")
Expand Down
File renamed without changes.

0 comments on commit 7b36f39

Please sign in to comment.