Raw
1 name: Update Version in Docs
2 on:
3 release:
4 types: [published]
5 workflow_dispatch:
6 inputs:
7 update_docs_version:
8 description: "Update the version in the docs config and open a PR"
9 type: boolean
10 default: true
11 create_cloud_announcement:
12 description: "Create the Cloud announcement for the latest release"
13 type: boolean
14 default: true
15
16 jobs:
17 update-docs-version:
18 if: github.event_name != 'workflow_dispatch' || inputs.update_docs_version
19 runs-on: ubuntu-latest
20 steps:
21 - name: Generate GitHub App token
22 id: app-token
23 uses: actions/create-github-app-token@v1
24 with:
25 app-id: ${{ secrets.MEDUSA_APP_ID }}
26 private-key: ${{ secrets.MEDUSA_APP_PRIVATE_KEY }}
27
28 - name: Cancel Previous Runs
29 uses: styfle/cancel-workflow-action@0.11.0
30 with:
31 access_token: ${{ github.token }}
32
33 - name: Checkout
34 uses: actions/checkout@v3
35 with:
36 fetch-depth: 0
37
38 - name: Setup Node.js environment
39 uses: actions/setup-node@v4
40 with:
41 node-version: 22
42 cache: "yarn"
43
44 - name: Install dependencies
45 uses: ./.github/actions/cache-deps
46 with:
47 extension: docs-update-version
48
49 - name: Install Workspace dependencies
50 run: yarn install
51 working-directory: www/utils
52
53 - name: Build Workspace packages
54 run: yarn build
55 working-directory: www/utils
56
57 - name: Update Docs Version
58 run: yarn update:config-version
59 env:
60 GH_TOKEN: ${{ steps.app-token.outputs.token }}
61 working-directory: www/utils/packages/scripts
62
63 - name: Create Pull Request
64 uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # v4
65 with:
66 token: ${{ steps.app-token.outputs.token }}
67 commit-message: "chore(docs): Update version in documentation (automated)"
68 base: "develop"
69 title: "chore(docs): Update version in documentation (automated)"
70 labels: "type: chore"
71 add-paths: www/packages/docs-utils/src/global-config.ts
72 branch: "docs/update-config-version"
73 branch-suffix: "timestamp"
74 create-cloud-announcement:
75 if: github.event_name != 'workflow_dispatch' || inputs.create_cloud_announcement
76 runs-on: ubuntu-latest
77 env:
78 ANNOUNCEMENTS_API_URL: ${{ secrets.ANNOUNCEMENTS_API_URL }}
79 ANNOUNCEMENTS_API_TOKEN: ${{ secrets.ANNOUNCEMENTS_API_TOKEN }}
80 steps:
81 - name: Checkout
82 uses: actions/checkout@v3
83 with:
84 fetch-depth: 0
85
86 - name: Setup Node.js environment
87 uses: actions/setup-node@v4
88 with:
89 node-version: 22
90
91 - name: Install dependencies
92 uses: ./.github/actions/cache-deps
93 with:
94 extension: docs-update-version
95
96 - name: Install Workspace dependencies
97 run: yarn install
98 working-directory: www/utils
99
100 - name: Build Workspace packages
101 run: yarn build
102 working-directory: www/utils
103
104 - name: Create Cloud Announcement
105 run: yarn create:cloud-announcement
106 working-directory: www/utils/packages/scripts