Skip to content

Commit

Permalink
💚 (actions): Deploy gh pages form gh action
Browse files Browse the repository at this point in the history
created a tentative action to deploy the gh-pages from an action instead of pushing to another branch
  • Loading branch information
csc530 committed Dec 11, 2023
1 parent 0ab4f7d commit 62e23b7
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version = 1

exclude_patterns = [
"dist/**",
".vuepress/.**"
"dist/**",
".vuepress/.**"
]

[[analyzers]]
name = "javascript"

[analyzers.meta]
plugins = ["vue"]
[analyzers.meta]
plugins = ["vue"]

[[analyzers]]
name = "secrets"
98 changes: 98 additions & 0 deletions .github/workflows/branchless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# This is a basic workflow to help you get started with Actions

name: docs CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths:
- 'docs/**'
- '.github/workflows/branchless.yml'
- "src/demos/**"
pull_request:
branches: [ "main" ]
paths:
- 'docs/**'
- '.github/workflows/branchless.yml'
- "src/demos/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
working-directory: docs

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# fetch all commits to get last updated time or other git log info
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
# choose pnpm version to use
version: 8
# install deps with pnpm
run_install: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
# choose node.js version to use
node-version: 18
# cache deps for pnpm
cache: pnpm

# run build script
- name: Build VuePress site
run: "pnpm docs:build"

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: .vuepress/dist

# Single deploy job since we're just deploying
deploy:
# Add a dependency to the build job
needs: build

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: '.vuepress/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build, commit, and deploy documentation to GitHub Pages

on:
push:
branches: main
branches: ["main"]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
Expand Down

0 comments on commit 62e23b7

Please sign in to comment.