-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (62 loc) · 2.04 KB
/
publish.yml
File metadata and controls
65 lines (62 loc) · 2.04 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
name: Release packages
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
# Use the PAT for git operations so the release PR update can trigger CI.
token: ${{ secrets.CHANGESETS_BOT_TOKEN }}
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
registry-url: "https://registry.npmjs.org"
scope: "@reflag"
- name: Install dependencies
run: yarn install --immutable
- name: Create release PR or publish packages
id: changesets
uses: changesets/action@v1
with:
version: yarn version-packages
publish: yarn release-packages
title: Version Packages
commit: Version Packages
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_BOT_TOKEN }}
- name: Build docs
if: steps.changesets.outputs.published == 'true'
run: yarn docs
- name: Checkout docs with SSH
if: steps.changesets.outputs.published == 'true'
uses: actions/checkout@v3
with:
repository: reflagcom/docs
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
path: reflag-docs
- name: Copy generated docs to docs repo
if: steps.changesets.outputs.published == 'true'
run: |
rm -rf reflag-docs/sdk
cp -R dist/docs reflag-docs/sdk
- name: Commit and push changes
if: steps.changesets.outputs.published == 'true'
run: |
cd reflag-docs
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@reflag.com"
git add sdk
git commit -m "Update documentation" && git push || echo "No docs changes to commit"