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 - 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.GITHUB_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"