DEPLOY Astro site to Pages #2
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
# build&deploy λόγος Astro site to GitHub Pages | |
# https://docs.astro.build/en/getting-started/ | |
name: DEPLOY Astro site to Pages | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
# Allows running this workflow manually from the GitHub 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 only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
BUILD_PATH: "." # default value when not using subfolders | |
# BUILD_PATH: subfolder | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout your repository using git | |
uses: actions/checkout@v3 | |
- name: Install, build, and upload your site output | |
uses: withastro/action@v0 | |
with: | |
path: . # root location of your Astro project inside the repository | |
node-version: 16 # version of Node that should be used to build, defaults to 16 (optional) | |
package-manager: npm # The Node package manager that should be used to install dependencies, automatically detected based on lockfile (optional) | |
# resolve-dep-from-path: false # If the dependency file should be resolved from the root location of your Astro project. Defaults to `true`. (optional) | |
deploy: | |
needs: build | |
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 |