-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (46 loc) · 1.37 KB
/
migrate_publish.yml
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
name: Migrate and publish demo site
on:
push:
branches:
- master
workflow_dispatch:
jobs:
migrate-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
- name: Checkout demo site
uses: actions/checkout@v3
with:
repository: ${{ secrets.DEPLOY_REPO }}
ref: ${{ secrets.DEPLOY_BRANCH }}
ssh-key: ${{ secrets.DEPLOY_KEY }}
path: demo-site
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ">=18.16.0"
check-latest: true
cache: yarn
- name: Install dependencies
run: |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/
yarn install --frozen-lockfile
- name: Configure environment
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Migrate
run: |
export ROOT_DIR="$(pwd)/demo-site"
export COMMIT_SHA_SHORT="$(git rev-parse --short HEAD)"
node App/migrate_ci.js
- name: Publish
run: |
cd demo-site
git add .
git commit -m "Auto-commit from CI: ${GITHUB_SHA}"
git push