Skip to content

Commit

Permalink
add deploy workflow #1
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Jan 20, 2024
1 parent 00e979d commit d08e446
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Build
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
inputs:
branch:
description: 'Branch to build'
required: true
default: 'master'

jobs:
build:
Expand Down Expand Up @@ -52,3 +54,9 @@ jobs:
with:
start: npm run start
record: false

- name: Upload build results
uses: actions/upload-artifact@v2
with:
name: build
path: out
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy

on:
push:
branches:
- master

jobs:
build:
uses: ./build.yml
with:
branch: ${{ github.event.head_commit.message }}

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Download build results
uses: actions/download-artifact@v2
with:
name: build
path: ./out
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
publish_branch: gh-pages
force_orphan: true
enable_jekyll: false
clean: true
commit_message: ${{ github.event.head_commit.message }}
commit_user_name: ${{ github.event.head_commit.author.name }}
commit_user_email: ${{ github.event.head_commit.author.email }}

0 comments on commit d08e446

Please sign in to comment.