Test2 #62
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
name: GitHub Pages CI (Astro) | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
BUILD_PATH: . | |
SITE_URL: https://avonbied.github.io | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/hydrogen | |
cache: 'yarn' | |
cache-dependency-path: ${{ env.BUILD_PATH }}/*.lock | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v3 | |
- name: Install dependencies | |
run: yarn install | |
working-directory: ${{ env.BUILD_PATH }} | |
- name: Build with Astro | |
run: | | |
yarn astro build \ | |
--base "${{ steps.pages.outputs.base_path }}" | |
working-directory: ${{ env.BUILD_PATH }} | |
env: | |
SITE_URL: "${{ steps.pages.outputs.origin }}" | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ${{ env.BUILD_PATH }}/dist | |
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 |