Skip to content

Commit

Permalink
[+] Create deploy-to-branch.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sauricat authored Sep 17, 2024
1 parent 78a73db commit c4560fa
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy-to-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: GitHub Pages (Branch Invoked)
# To see the workflow clearer, I try to deploy first to a branch and then publish it.

on:
push:
branches:
- main # Set a branch to deploy
pull_request:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write
deployments: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm i
- name: Build page
run: pnpm docs:build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: deploy
cname: oneamongus.ca
destination_dir: ./.

0 comments on commit c4560fa

Please sign in to comment.