|
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [develop, beta] |
| 5 | + branches: [main, beta] |
6 | 6 | pull_request: |
7 | | - branches: [develop, beta] |
| 7 | + branches: [main, beta] |
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build-and-test: |
@@ -51,12 +51,15 @@ jobs: |
51 | 51 | command_description: ${{ matrix.command_description }} |
52 | 52 | needs_playwright: ${{ matrix.needs_playwright }} |
53 | 53 | needs_lfs: ${{ matrix.needs_lfs }} |
| 54 | + secrets: inherit |
54 | 55 |
|
55 | 56 | release: |
56 | 57 | name: Release (latest or beta) |
57 | | - if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' |
| 58 | + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' |
58 | 59 | needs: [build-and-test] |
59 | 60 | runs-on: ubuntu-latest |
| 61 | + env: |
| 62 | + BETTER_AUTH_SECRET: ${{ secrets.AUTH_SECRET || 'ci-build-placeholder-secret' }} |
60 | 63 | outputs: |
61 | 64 | published: ${{ steps.changesets.outputs.published }} |
62 | 65 | steps: |
|
79 | 82 | title: "chore(new-release)" |
80 | 83 | commit: "chore(new-release)" |
81 | 84 | branch: ${{ github.ref == 'refs/heads/beta' && 'beta' || null }} |
82 | | - createGithubReleases: ${{ github.ref == 'refs/heads/develop' }} |
| 85 | + createGithubReleases: ${{ github.ref == 'refs/heads/main' }} |
83 | 86 | env: |
84 | 87 | GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} |
85 | 88 | NPM_TOKEN: ${{ secrets.NPM_API_KEY }} |
|
95 | 98 | This is necessary because the PR is updated by github-actions[bot]. |
96 | 99 | This is a technical user which does not trigger actions workflows on push events. |
97 | 100 | See this GH issue for more details: https://github.com/changesets/action/issues/187 |
98 | | -
|
99 | | - update-docs: |
100 | | - name: Update main site stackoverflow.design |
101 | | - if: ${{ needs.release.outputs.published == 'true' && github.ref == 'refs/heads/develop' }} |
102 | | - needs: [build-and-test, release] |
103 | | - runs-on: ubuntu-latest |
104 | | - steps: |
105 | | - - uses: actions/checkout@v5 |
106 | | - - name: 🔄 Update stackoverflow.design docs |
107 | | - run: | |
108 | | - git config --global user.name 'github-actions[bot]' |
109 | | - git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
110 | | - git fetch origin |
111 | | - git checkout production |
112 | | - git merge --no-ff --allow-unrelated-histories origin/develop -m "chore: merge develop into production" |
113 | | - git push origin production |
114 | | - env: |
115 | | - GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} |
116 | | - |
117 | 101 | # cancel the jobs if another workflow is kicked off for the same branch |
118 | 102 | concurrency: |
119 | 103 | group: ${{ github.workflow }}-${{ github.ref }} |
|
0 commit comments