-
Notifications
You must be signed in to change notification settings - Fork 46
76 lines (65 loc) · 2.44 KB
/
Copy pathformat-and-stamp.yml
File metadata and controls
76 lines (65 loc) · 2.44 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
name: Format & stamp
on:
push:
branches:
- main
- staging
workflow_dispatch:
permissions:
contents: write
deployments: write
jobs:
format-and-stamp:
runs-on: blacksmith-4vcpu-ubuntu-2404
env:
PNPM_HOME: /home/runner/.local/share/pnpm
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js & pnpm
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install pnpm
run: |
corepack enable pnpm
mkdir -p "$PNPM_HOME"
echo "$PNPM_HOME" >> "$GITHUB_PATH"
- name: Cache pnpm global packages
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/global
key: pnpm-global-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-global-
- name: Install dependencies
run: pnpm add -g oxlint oxfmt esbuild html-minifier-terser
- name: Lint, format & version stamp
run: |
pnpm run fix || true
pnpm oxfmt --write . "**/*.{js,md,html,css,yml}"
echo "${{ github.sha }}" > game/images/Zombies/CX/v.html
- name: Commit changes
run: |
COMMIT_MSG=$(git log -1 --pretty=format:%s)
AUTHOR_EMAIL=$(git log -1 --pretty=format:%ae)
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Format \"$COMMIT_MSG\" [CF-Pages-Skip]
Original commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
Co-authored-by: ${{ github.actor }} <$AUTHOR_EMAIL>" || exit 0
git push
mirror:
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: format-and-stamp
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@tangled.org:pvzm.net/game
ssh_private_key: ${{ secrets.TANGLED_SSH_PRIVATE_KEY }}