|
1 |
| -name: 🔖 Release |
| 1 | +name: Deploy Web Application |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - main |
7 |
| - |
8 |
| -concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + node_version: |
| 7 | + description: The Node.js version to use for the workflow. |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + build_directory: |
| 11 | + description: The directory containing the build files to deploy. |
| 12 | + required: true |
| 13 | + type: string |
9 | 14 |
|
10 | 15 | jobs:
|
11 | 16 | release:
|
12 |
| - name: 🔖 Release |
| 17 | + name: 🔖 Create Release |
| 18 | + |
13 | 19 | runs-on: ubuntu-latest
|
14 | 20 | steps:
|
15 |
| - - name: Checkout Repo |
16 |
| - uses: actions/checkout@v3 |
17 |
| - |
18 |
| - - uses: pnpm/action-setup@v4 |
19 |
| - name: Install pnpm |
| 21 | + - name: Setup |
| 22 | + uses: ./.github/workflows/setup.yml |
20 | 23 | with:
|
21 |
| - run_install: false |
| 24 | + node_version: ${{ inputs.node_version }} # Use the Node.js version passed from the calling workflow |
| 25 | + - name: Apply Changesets |
| 26 | + run: pnpm changeset version |
22 | 27 |
|
23 |
| - - name: Install Node.js |
24 |
| - uses: actions/setup-node@v4 |
25 |
| - with: |
26 |
| - node-version: 20 |
27 |
| - cache: "pnpm" |
| 28 | + - name: Build Application |
| 29 | + run: pnpm build |
28 | 30 |
|
29 |
| - - name: Install dependencies |
30 |
| - run: pnpm install |
31 |
| - |
32 |
| - - name: Validate Turborepo Build |
33 |
| - run: pnpm turbo run build |
34 |
| - |
35 |
| - - name: Create Release Pull Request |
36 |
| - uses: changesets/action@v1 |
| 31 | + - name: Upload Build Artifacts |
| 32 | + uses: actions/upload-artifact@v3 |
| 33 | + with: |
| 34 | + name: build-artifacts |
| 35 | + path: ${{ inputs.build_directory }} # Use the build directory passed from the calling workflow |
| 36 | + |
| 37 | + - name: Commit Version Bumps |
| 38 | + run: | |
| 39 | + git config user.name "GitHub Actions Bot" |
| 40 | + git config user.email "actions@github.com" |
| 41 | + git add . |
| 42 | + git commit -m "chore: apply version bumps" |
| 43 | + git push origin main |
| 44 | +
|
| 45 | + - name: Push Tags |
| 46 | + run: git push --tags |
| 47 | + |
| 48 | + - name: Create GitHub Release |
| 49 | + uses: softprops/action-gh-release@v2 |
37 | 50 | with:
|
38 |
| - commit: "chore: :bookmark: update versions and changelog" |
39 |
| - title: "chore: :bookmark: version bump and changelog update" |
| 51 | + tag_name: ${{ github.ref_name }} |
| 52 | + name: Release ${{ github.ref_name }} |
| 53 | + body_path: ./CHANGELOG.md |
40 | 54 | env:
|
41 | 55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
0 commit comments