Skip to content

Commit

Permalink
👷 publish site as workflow artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Aug 31, 2023
1 parent 7ab028d commit 1b6a0d1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 13 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Checks

on:
pull_request:
branches: [main]

push:
branches: [main]

workflow_dispatch:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.branch }}

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16.14.2
cache: npm

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Prettier
run: npx prettier -l -u .
43 changes: 30 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
name: Publish site
name: Publish service
on:
push:
branches: [ master ]
branches: [main]

workflow_dispatch:

jobs:
publish:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish site
run: |
wget https://github.com/tmijs/tmi.js/releases/download/v1.8.5/tmi.min.js -O ./html/overlay/tmi.min.js
mv ./html ./docs
git config user.email git@github.com
git config user.name 'GitHub Actions'
git add .
git commit -m 'Publish site'
git push -f -u origin master:gh-pages
- uses: actions/checkout@v2

- name: Build
run: |
wget https://github.com/tmijs/tmi.js/releases/download/v1.8.5/tmi.min.js -O ./html/tmi.min.js
- uses: actions/upload-pages-artifact@v2
with:
path: html/

deploy:
runs-on: ubuntu-latest
needs: build

permissions:
pages: write
id-token: write

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

steps:
- id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 1b6a0d1

Please sign in to comment.