-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.52 KB
/
build.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This is a workflow to build, package, and deploy a Vue.js app to GitHub Pages
name: Build, Package and Deploy to GitHub Pages
# Controls when the workflow will run
on:
# Triggers the workflow on push events but only for the "main" branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build-package-and-deploy:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3
# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20" # Set this to the Node.js version you use
# Install dependencies
- name: Install Dependencies
run: npm install
# Build the Vue app
- name: Build
run: npm run build
# Fix file permissions
- name: Fix Permissions
run: |
chmod -c -R +rX dist/ | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
# Package and upload the artifact
- name: Package and Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
- name: List output files
run: ls -l dist
# Deploy to GitHub Pages
- name: Deploy GitHub Pages site
uses: actions/deploy-pages@v4.0.5
with:
token: ${{ github.token }}