Skip to content

Commit

Permalink
chore: automate gh deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Jun 25, 2024
1 parent f747087 commit 801932d
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
branches: [main]

jobs:
gh-deploy:
merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-deploy

- uses: actions/setup-node@v4
with:
node-version: 18
Expand All @@ -26,14 +26,56 @@ jobs:
target_branch: gh-deploy
github_token: ${{ secrets.GITHUB_TOKEN }}


build:
runs-on: ubuntu-latest
needs: merge
steps:
- uses: actions/checkout@v4
with:
ref: gh-deploy

- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org
cache: 'yarn'

- name: Install
run: yarn install

- name: Build
working-directory: '.'
run: yarn build:pages

- name: Deploy
- name: Update `gh-pages` branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build

- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: build

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

permissions:
id-token: write
pages: write

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

steps:
- uses: actions/download-artifact@master
with:
name: github-pages
path: build
- uses: actions/configure-pages@v5
- id: deployment
uses: actions/deploy-pages@main

0 comments on commit 801932d

Please sign in to comment.