|
1 | | -# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
2 | 1 | name: Deploy Jekyll with GitHub Pages dependencies preinstalled |
3 | 2 |
|
4 | 3 | on: |
5 | | - # Runs on pushes targeting the default branch |
6 | 4 | push: |
7 | 5 | branches: ["main"] |
8 | | - |
9 | | - # Allows you to run this workflow manually from the Actions tab |
| 6 | + paths-ignore: |
| 7 | + - 'VERSION' |
10 | 8 | workflow_dispatch: |
11 | 9 |
|
12 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
13 | 10 | permissions: |
14 | | - contents: read |
| 11 | + contents: write |
15 | 12 | pages: write |
16 | 13 | id-token: write |
17 | 14 |
|
18 | | -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
19 | | -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
20 | 15 | concurrency: |
21 | 16 | group: "pages" |
22 | 17 | cancel-in-progress: false |
23 | 18 |
|
24 | 19 | jobs: |
25 | | - # Build job |
26 | 20 | build: |
27 | 21 | runs-on: ubuntu-latest |
| 22 | + outputs: |
| 23 | + version: ${{ steps.version.outputs.VERSION }} |
28 | 24 | steps: |
29 | 25 | - name: Checkout |
30 | 26 | uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Set version |
| 29 | + id: version |
| 30 | + run: | |
| 31 | + VERSION="1.0.${{ github.run_number }}" |
| 32 | + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT |
| 33 | + echo "$VERSION" > VERSION |
| 34 | +
|
| 35 | + - name: Commit version file |
| 36 | + run: | |
| 37 | + git config user.name "github-actions[bot]" |
| 38 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 39 | + git add VERSION |
| 40 | + git diff --staged --quiet || git commit -m "Bump version to ${{ steps.version.outputs.VERSION }} [skip ci]" |
| 41 | + git push |
| 42 | +
|
31 | 43 | - name: Setup Pages |
32 | 44 | uses: actions/configure-pages@v5 |
| 45 | + |
33 | 46 | - name: Build with Jekyll |
34 | 47 | uses: actions/jekyll-build-pages@v1 |
35 | 48 | with: |
36 | 49 | source: ./ |
37 | 50 | destination: ./_site |
| 51 | + |
38 | 52 | - name: Upload artifact |
39 | 53 | uses: actions/upload-pages-artifact@v3 |
40 | 54 |
|
41 | | - # Deployment job |
42 | 55 | deploy: |
43 | 56 | environment: |
44 | 57 | name: github-pages |
|
49 | 62 | - name: Deploy to GitHub Pages |
50 | 63 | id: deployment |
51 | 64 | uses: actions/deploy-pages@v4 |
| 65 | + |
| 66 | + release: |
| 67 | + runs-on: ubuntu-latest |
| 68 | + needs: build |
| 69 | + steps: |
| 70 | + - name: Checkout |
| 71 | + uses: actions/checkout@v4 |
| 72 | + |
| 73 | + - name: Create Release |
| 74 | + uses: softprops/action-gh-release@v1 |
| 75 | + with: |
| 76 | + tag_name: v${{ needs.build.outputs.version }} |
| 77 | + name: Release ${{ needs.build.outputs.version }} |
| 78 | + body: | |
| 79 | + ## MCAF Release ${{ needs.build.outputs.version }} |
| 80 | +
|
| 81 | + Managed Code Coding AI Framework |
| 82 | + draft: false |
| 83 | + prerelease: false |
| 84 | + generate_release_notes: true |
0 commit comments