Files
starter-workflows/pages/astro.yml
T

57 lines
1.4 KiB
YAML
Raw Normal View History

2022-09-27 21:19:54 -07:00
# 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/
#
2022-09-29 15:22:03 -07:00
name: Deploy Astro site to Pages
2022-09-27 21:19:54 -07:00
on:
2022-10-20 16:06:10 -07:00
# Runs on pushes targeting the default branch
2022-09-27 21:19:54 -07:00
push:
2022-10-20 16:06:10 -07:00
branches: [$default-branch]
# Allows you to run this workflow manually from the Actions tab
2022-09-27 21:19:54 -07:00
workflow_dispatch:
2022-10-20 16:06:10 -07:00
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
2022-09-27 21:19:54 -07:00
permissions:
contents: read
pages: write
id-token: write
2022-10-20 16:06:10 -07:00
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
2022-09-27 21:19:54 -07:00
env:
2022-10-20 16:06:10 -07:00
PAT: "." # default value when not using subfolders
2022-09-27 21:19:54 -07:00
# PAT: subfolder
jobs:
build:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache-dependency-path: ${{ env.PAT }}/package-lock.json
- run: npm install && npm run build
working-directory: ${{ env.PAT }}
- uses: actions/upload-pages-artifact@v1
with:
path: ${{ env.PAT }}/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