-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32755ee
commit ec2a59f
Showing
1 changed file
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
# This is a workflow to build and deploy a Vue.js app to GitHub Pages | ||
# This is a workflow to build, package, and deploy a Vue.js app to GitHub Pages | ||
|
||
name: Build and Deploy 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" ] | ||
branches: ["main"] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Token must be able to push to pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build-and-deploy: | ||
# The type of runner that the job will run on | ||
build-package-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
# Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
# Setup Node.js environment | ||
# 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 | ||
node-version: "20" # Set this to the Node.js version you use | ||
|
||
# Install dependencies | ||
- name: Install Dependencies | ||
|
@@ -42,13 +37,21 @@ jobs: | |
- name: Build | ||
run: npm run build | ||
|
||
# Deploy to GitHub Pages using the new action | ||
# 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 | ||
|
||
# Deploy to GitHub Pages | ||
- name: Deploy GitHub Pages site | ||
uses: actions/[email protected] | ||
with: | ||
token: ${{ github.token }} | ||
timeout: 600000 | ||
error_count: 10 | ||
reporting_interval: 5000 | ||
artifact_name: github-pages # Name of the artifact produced by a previous step; adjust if necessary | ||
preview: false |