-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (76 loc) · 3.34 KB
/
Copy pathdeploy.yaml
File metadata and controls
79 lines (76 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Deploy
on:
workflow_dispatch:
workflow_call:
secrets:
DEPLOY_TOKEN:
description: 'PAT scoped to roma-js repositories'
required: true
permissions:
contents: write
jobs:
build-and-deploy:
# prevents this action from running on forks or branches that are not main
if: ${{ github.repository == 'Roma-JS/roma-js-on-astro' && github.ref == 'refs/heads/main' }}
concurrency:
group: website-deploy-lock
cancel-in-progress: false
runs-on: ubuntu-24.04
env:
HUSKY: '0'
TZ: 'Europe/Rome'
PUBLIC_SITE_URL: "https://romajs.org"
steps:
- name: Checkout 🛎️
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
ref: 'main'
token: ${{ secrets.DEPLOY_TOKEN }}
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
- name: Setup corepack
run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
- name: log node & package manager
run: 'printf "node -> %s\npnpm -> %s" "$(node -v)" "$(pnpm -v)"'
- name: Log Execution Details to Summary
run: |
echo "### 🚀 deployment triggered" >> $GITHUB_STEP_SUMMARY
echo "* **triggered by:** @${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
echo "* **trigger branch/Ref:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "* **trigger event:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "* **timestamp:** $(date -u -d "${{ github.event.repository.updated_at }}" '+%Y-%m-%d %H:%M:%S UTC' 2>/dev/null || date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY
printf '* **node**: %s\n* **pnpm**: %s\n' "$(node -v)" "$(pnpm -v)" >> $GITHUB_STEP_SUMMARY
echo "* **job runner**: $(uname -a)" >> $GITHUB_STEP_SUMMARY
- name: Get pnpm store directory
id: pnpm-store
run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
key: pnpm-store-${{ github.repository_id }}-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ github.repository_id }}-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build site
run: pnpm run build
- name: Post build actions
run: touch ./dist/.nojekyll # Avoids 404 when pathname includes underscores
- name: Deploy roma-js site 🚀
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
repository-name: "Roma-JS/roma-js.github.io"
token: ${{ secrets.DEPLOY_TOKEN }}
branch: "master" # The branch the action should deploy to.
folder: dist
clean: true
clean-exclude: | # These files do not get wiped
CNAME