-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.12 KB
/
default.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Default Pipeline
on:
pull_request:
push:
branches:
- "main"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout repo
uses: actions/checkout@v4
- name: 📥 Download deps default-npm-cache
if: steps.npm-cache.outputs.cache-hit != 'true'
uses: bahmutov/npm-install@v1
- name: ⏬ Get branch name
uses: actions/github-script@v7
id: get-branch-name
with:
result-encoding: string
script: |
return (
context?.payload?.pull_request?.head?.ref ||
context?.payload?.ref || ""
)
.replace("refs/heads/","");
- name: 🔨 Build
env:
VITE_FEATURE_BRANCH: /${{steps.get-branch-name.outputs.result}}
run: npm run build
- name: 🥅 Deploy to GH-Pages
if: ${{ github.actor != 'dependabot[bot]' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: ${{steps.get-branch-name.outputs.result}}