57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
# Sample workflow for building and deploying an Astro site to GitHub Pages
|
|
#
|
|
# To get started with Astro see: https://docs.astro.build/en/getting-started/
|
|
#
|
|
name: Deploy Astro site to Pages
|
|
|
|
on:
|
|
# Runs on pushes targeting the default branch
|
|
push:
|
|
branches: [$default-branch]
|
|
|
|
# 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 one concurrent deployment
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
BUILD_PATH: "." # default value when not using subfolders
|
|
# BUILD_PATH: subfolder
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json
|
|
- run: npm install && npm run build
|
|
working-directory: ${{ env.BUILD_PATH }}
|
|
- uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: ${{ env.BUILD_PATH }}/dist
|
|
|
|
deploy:
|
|
needs: build
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|