|
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [develop, beta] |
| 5 | + branches: [v2] |
6 | 6 | pull_request: |
7 | | - branches: [develop, beta] |
| 7 | + branches: [v2] |
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build-and-test: |
@@ -49,12 +49,10 @@ jobs: |
49 | 49 | needs_lfs: ${{ matrix.needs_lfs }} |
50 | 50 |
|
51 | 51 | release: |
52 | | - name: Release (latest or beta) |
53 | | - if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' |
| 52 | + name: Release (v2) |
| 53 | + if: github.ref == 'refs/heads/v2' |
54 | 54 | needs: [build-and-test] |
55 | 55 | runs-on: ubuntu-latest |
56 | | - outputs: |
57 | | - published: ${{ steps.changesets.outputs.published }} |
58 | 56 | steps: |
59 | 57 | - uses: actions/checkout@v5 |
60 | 58 | - name: Setup Node.js environment |
|
74 | 72 | publish: npm run release |
75 | 73 | title: "chore(new-release)" |
76 | 74 | commit: "chore(new-release)" |
77 | | - branch: ${{ github.ref == 'refs/heads/beta' && 'beta' || null }} |
78 | | - createGithubReleases: ${{ github.ref == 'refs/heads/develop' }} |
| 75 | + createGithubReleases: true |
79 | 76 | env: |
80 | 77 | GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} |
81 | 78 | NPM_TOKEN: ${{ secrets.NPM_API_KEY }} |
|
92 | 89 | This is a technical user which does not trigger actions workflows on push events. |
93 | 90 | See this GH issue for more details: https://github.com/changesets/action/issues/187 |
94 | 91 |
|
95 | | - update-docs: |
96 | | - name: Update main site stackoverflow.design |
97 | | - if: ${{ needs.release.outputs.published == 'true' && github.ref == 'refs/heads/develop' }} |
98 | | - needs: [build-and-test, release] |
99 | | - runs-on: ubuntu-latest |
100 | | - steps: |
101 | | - - uses: actions/checkout@v5 |
102 | | - - name: 🔄 Update stackoverflow.design docs |
103 | | - run: | |
104 | | - git config --global user.name 'github-actions[bot]' |
105 | | - git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
106 | | - git fetch origin |
107 | | - git checkout production |
108 | | - git merge --no-ff --allow-unrelated-histories origin/develop -m "chore: merge develop into production" |
109 | | - git push origin production |
110 | | - env: |
111 | | - GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} |
112 | | - |
113 | 92 | # cancel the jobs if another workflow is kicked off for the same branch |
114 | 93 | concurrency: |
115 | 94 | group: ${{ github.workflow }}-${{ github.ref }} |
|
0 commit comments