Skip to content

Commit b669f03

Browse files
Update deployment action
1 parent 638afab commit b669f03

2 files changed

Lines changed: 15 additions & 69 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 14 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,35 @@
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-
#
5-
name: Deploy to Production
1+
# Last sourced from: https://docs.astro.build/en/guides/deploy/github/
2+
name: Deploy to GitHub Pages
63

74
on:
8-
# Runs on pushes targeting the default branch
5+
# Trigger the workflow every time you push to the `main` branch
6+
# Using a different branch name? Replace `main` with your branch’s name
97
push:
10-
branches: ["master"]
11-
12-
# Allows you to run this workflow manually from the Actions tab
8+
branches: [ master ]
9+
# Allows you to run this workflow manually from the Actions tab on GitHub.
1310
workflow_dispatch:
1411

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
# Allow this job to clone the repo and create a page deployment
1613
permissions:
1714
contents: read
1815
pages: write
1916
id-token: write
2017

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.
23-
concurrency:
24-
group: "pages"
25-
cancel-in-progress: false
26-
27-
env:
28-
BUILD_PATH: "." # default value when not using subfolders
29-
# BUILD_PATH: subfolder
30-
3118
jobs:
3219
build:
33-
name: Build
3420
runs-on: ubuntu-latest
3521
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v4
38-
- name: Detect package manager
39-
id: detect-package-manager
40-
run: |
41-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
42-
echo "manager=yarn" >> $GITHUB_OUTPUT
43-
echo "command=install" >> $GITHUB_OUTPUT
44-
echo "runner=yarn" >> $GITHUB_OUTPUT
45-
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
46-
exit 0
47-
elif [ -f "${{ github.workspace }}/package.json" ]; then
48-
echo "manager=npm" >> $GITHUB_OUTPUT
49-
echo "command=ci" >> $GITHUB_OUTPUT
50-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
51-
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
52-
exit 0
53-
else
54-
echo "Unable to determine package manager"
55-
exit 1
56-
fi
57-
- name: Setup Node
58-
uses: actions/setup-node@v4
59-
with:
60-
node-version: "20"
61-
cache: ${{ steps.detect-package-manager.outputs.manager }}
62-
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
63-
- name: Setup Pages
64-
id: pages
65-
uses: actions/configure-pages@v5
66-
- name: Install dependencies
67-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
68-
working-directory: ${{ env.BUILD_PATH }}
69-
- name: Build with Astro
70-
run: |
71-
${{ steps.detect-package-manager.outputs.runner }} astro build \
72-
--site "${{ steps.pages.outputs.origin }}" \
73-
--base "${{ steps.pages.outputs.base_path }}"
74-
working-directory: ${{ env.BUILD_PATH }}
75-
- name: Upload artifact
76-
uses: actions/upload-pages-artifact@v3
77-
with:
78-
path: ${{ env.BUILD_PATH }}/dist
79-
22+
- name: Checkout your repository using git
23+
uses: actions/checkout@v6
24+
- name: Install, build, and upload your site
25+
uses: withastro/action@v6
8026
deploy:
27+
needs: build
28+
runs-on: ubuntu-latest
8129
environment:
8230
name: github-pages
8331
url: ${{ steps.deployment.outputs.page_url }}
84-
needs: build
85-
runs-on: ubuntu-latest
86-
name: Deploy
8732
steps:
8833
- name: Deploy to GitHub Pages
8934
id: deployment
90-
uses: actions/deploy-pages@v4
35+
uses: actions/deploy-pages@v5

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import starlightAutoSidebar from 'starlight-auto-sidebar'
55

66
// https://astro.build/config
77
export default defineConfig({
8+
site: 'https://beta-docs.skriptlang.org',
89
integrations: [
910
starlight({
1011
plugins: [starlightAutoSidebar()],

0 commit comments

Comments
 (0)