Skip to content

Commit 45a0867

Browse files
committed
Separate readme & website workflow
1 parent 68d3478 commit 45a0867

File tree

2 files changed

+47
-42
lines changed

2 files changed

+47
-42
lines changed

.github/workflows/deploy-readme.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Readme
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Deploy"]
6+
types:
7+
- completed
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.18.1'
22+
cache: 'yarn'
23+
24+
- name: Install dependencies
25+
run: yarn focus @teimurjan/profile-readme
26+
27+
- name: Generate readme
28+
run: yarn workspace @teimurjan/profile-readme generate-readme
29+
30+
- name: Clone teimurjan repo
31+
run: |
32+
git clone https://x-access-token:${{ secrets.TEIMURJAN_REPO_TOKEN }}@github.com/teimurjan/teimurjan.git
33+
34+
- name: Copy readme to teimurjan
35+
run: |
36+
cp README.md teimurjan/README.md
37+
38+
- name: Commit and push changes to teimurjan
39+
working-directory: teimurjan
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git add README.md
44+
git commit -m "Update README.md content from teimurjan.github.io" || echo "No changes to commit"
45+
git push origin HEAD:main

.github/workflows/deploy.yml

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ on:
99
- '!workspaces/functions/**'
1010
workflow_dispatch:
1111

12-
env:
13-
GENERATED_README_KEY: readme
14-
1512
jobs:
1613
deploy:
17-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-latest
1815
concurrency:
1916
group: ${{ github.workflow }}-${{ github.ref }}
2017
steps:
@@ -30,23 +27,14 @@ jobs:
3027
run: sudo apt-get install -y xvfb
3128

3229
- name: Install dependencies
33-
run: yarn install
30+
run: yarn
3431

3532
- name: Generate opengraph
3633
run: yarn workspace @teimurjan/website generate-opengraph:ci
3734

3835
- name: Generate resume
3936
run: yarn workspace @teimurjan/website generate-resume
4037

41-
- name: Generate readme
42-
run: yarn workspace @teimurjan/profile-readme generate-readme
43-
44-
- name: Upload readme artifact
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: ${{ env.GENERATED_README_KEY }}
48-
path: workspaces/profile-readme/README.md
49-
5038
- name: Build
5139
run: yarn workspace @teimurjan/website build
5240

@@ -56,31 +44,3 @@ jobs:
5644
with:
5745
github_token: ${{ secrets.GITHUB_TOKEN }}
5846
publish_dir: ./workspaces/website/out
59-
60-
deploy-profile:
61-
runs-on: ubuntu-20.04
62-
needs: deploy
63-
concurrency:
64-
group: ${{ github.workflow }}-${{ github.ref }}
65-
steps:
66-
- name: Download readme artifact
67-
uses: actions/download-artifact@v4
68-
with:
69-
name: ${{ env.GENERATED_README_KEY }}
70-
71-
- name: Clone teimurjan repo
72-
run: |
73-
git clone https://x-access-token:${{ secrets.TEIMURJAN_REPO_TOKEN }}@github.com/teimurjan/teimurjan.git
74-
75-
- name: Copy readme to teimurjan
76-
run: |
77-
cp README.md teimurjan/README.md
78-
79-
- name: Commit and push changes to teimurjan
80-
working-directory: teimurjan
81-
run: |
82-
git config user.name "github-actions[bot]"
83-
git config user.email "github-actions[bot]@users.noreply.github.com"
84-
git add README.md
85-
git commit -m "Update README.md content from teimurjan.github.io" || echo "No changes to commit"
86-
git push origin HEAD:main

0 commit comments

Comments
 (0)