Skip to content

Commit d547aa5

Browse files
Update astro.yml
1 parent c795b60 commit d547aa5

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

.github/workflows/astro.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,26 @@
1-
# Sample workflow for building and deploying an Astro site to GitHub Pages
2-
#
3-
# To get started with Astro see: https://docs.astro.build/en/getting-started/
4-
#
51
name: Deploy Astro site to Pages
62

73
on:
8-
# Runs on pushes targeting the default branch
94
push:
105
branches: ["Development"]
11-
12-
# Allows you to run this workflow manually from the Actions tab
136
workflow_dispatch:
147

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
168
permissions:
179
contents: read
1810
pages: write
1911
id-token: write
2012

21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2313
concurrency:
2414
group: "pages"
2515
cancel-in-progress: false
2616

2717
env:
28-
BUILD_PATH: "." # default value when not using subfolders
29-
# BUILD_PATH: subfolder
18+
BUILD_PATH: "."
3019

3120
jobs:
3221
build:
3322
name: Build
34-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04
3524
steps:
3625
- name: Checkout
3726
uses: actions/checkout@v4
@@ -64,25 +53,32 @@ jobs:
6453
id: pages
6554
uses: actions/configure-pages@v5
6655
- name: Install dependencies
67-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
56+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} --force
57+
working-directory: ${{ env.BUILD_PATH }}
58+
- name: Update Astro and dependencies
59+
run: ${{ steps.detect-package-manager.outputs.manager }} install astro@latest @astrojs/tailwind@latest @astrojs/react@latest @astrojs/rss@latest
6860
working-directory: ${{ env.BUILD_PATH }}
69-
- name: Build with Astro
61+
- name: Build with Astro and copy to public
7062
run: |
7163
${{ steps.detect-package-manager.outputs.runner }} astro build \
7264
--site "${{ steps.pages.outputs.origin }}" \
73-
--base "${{ steps.pages.outputs.base_path }}"
65+
--base "/"
66+
rm -rf public/* && cp -r dist/* public/
7467
working-directory: ${{ env.BUILD_PATH }}
68+
env:
69+
GH_TOKEN: ${{ secrets.GH_PAT }}
70+
OPENWEATHER_API_KEY: ${{ secrets.OPENWEATHER_API_KEY }}
7571
- name: Upload artifact
7672
uses: actions/upload-pages-artifact@v3
7773
with:
78-
path: ${{ env.BUILD_PATH }}/dist
74+
path: ${{ env.BUILD_PATH }}/public
7975

8076
deploy:
8177
environment:
8278
name: github-pages
8379
url: ${{ steps.deployment.outputs.page_url }}
8480
needs: build
85-
runs-on: ubuntu-latest
81+
runs-on: ubuntu-24.04
8682
name: Deploy
8783
steps:
8884
- name: Deploy to GitHub Pages

0 commit comments

Comments
 (0)