|
2 | 2 | --- |
3 | 3 | name: Build uChill Image |
4 | 4 | on: |
5 | | -# Run on a schedule every UTC Monday & Thursday 23:00 |
6 | | -# or JST Tuesday & Friday 8:00 |
7 | | -# only run on default branch (main) |
| 5 | + # Run on a schedule every UTC Monday & Thursday 23:00 |
| 6 | + # or JST Tuesday & Friday 8:00 |
| 7 | + # only run on default branch (main) |
8 | 8 | schedule: |
9 | | - - cron: '0 23 * * MON,THU' |
| 9 | + - cron: "0 23 * * MON,THU" |
10 | 10 |
|
11 | | -# Run on push of the main and dev branch |
| 11 | + # Run on push of the main and dev branch |
12 | 12 | push: |
13 | 13 | branches: |
14 | 14 | - main |
15 | 15 | - dev |
16 | 16 | paths: |
17 | | - - 'src/**' |
18 | | -# Partially run on pull_request (only check build) |
| 17 | + - "src/**" |
| 18 | + # Partially run on pull_request (only check build) |
19 | 19 | pull_request: |
20 | 20 | branches: |
21 | 21 | - main |
22 | 22 | - dev |
23 | 23 | paths: |
24 | | - - 'src/**' |
25 | | -# Manual trigger when needed |
| 24 | + - "src/**" |
| 25 | + # Manual trigger when needed |
26 | 26 | workflow_dispatch: |
27 | 27 |
|
28 | 28 | concurrency: |
|
34 | 34 | runs-on: ubuntu-latest |
35 | 35 | strategy: |
36 | 36 | matrix: |
37 | | - nvidia: ['N', 'Y'] |
| 37 | + nvidia: ["N", "Y"] |
38 | 38 |
|
39 | 39 | permissions: |
40 | 40 | contents: read |
|
47 | 47 | with: |
48 | 48 | tool-cache: true |
49 | 49 | docker-images: false |
50 | | - |
| 50 | + |
51 | 51 | - name: Checkout Code |
52 | 52 | uses: actions/checkout@v4 |
53 | 53 |
|
@@ -105,8 +105,7 @@ jobs: |
105 | 105 | tags: ${{ steps.metadata.outputs.tags }} |
106 | 106 | labels: ${{ steps.metadata.outputs.labels }} |
107 | 107 | oci: false |
108 | | - build-args: |
109 | | - NVIDIA=${{ env.NVIDIA }} |
| 108 | + build-args: NVIDIA=${{ env.NVIDIA }} |
110 | 109 |
|
111 | 110 | # From now, only do on schedule and push |
112 | 111 | - name: Login to GitHub Container Registry |
@@ -146,3 +145,36 @@ jobs: |
146 | 145 | TAGS: ${{ steps.push.outputs.digest }} |
147 | 146 | COSIGN_EXPERIMENTAL: false |
148 | 147 | COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} |
| 148 | + |
| 149 | + notify_success: |
| 150 | + needs: build |
| 151 | + if: success() |
| 152 | + runs-on: ubuntu-latest |
| 153 | + steps: |
| 154 | + - name: Send Matrix success notification |
| 155 | + uses: fadenb/matrix-chat-message@v0.0.6 |
| 156 | + with: |
| 157 | + homeserver: "matrix.org" |
| 158 | + token: ${{ secrets.MATRIX_TOKEN }} |
| 159 | + channel: ${{ secrets.MATRIX_CHANNEL }} |
| 160 | + message: | |
| 161 | + ✅ GitHub Action ${{ github.workflow }} completed successfully! |
| 162 | + Commit: ${{ github.sha }} |
| 163 | + NVidia: ${{ needs.build.outputs.nvidia }} |
| 164 | +
|
| 165 | + notify_failure: |
| 166 | + needs: build |
| 167 | + if: failure() |
| 168 | + runs-on: ubuntu-latest |
| 169 | + steps: |
| 170 | + - name: Send Matrix success notification |
| 171 | + uses: fadenb/matrix-chat-message@v0.0.6 |
| 172 | + with: |
| 173 | + homeserver: "matrix.org" |
| 174 | + token: ${{ secrets.MATRIX_TOKEN }} |
| 175 | + channel: ${{ secrets.MATRIX_CHANNEL }} |
| 176 | + message: | |
| 177 | + 🚨 GitHub Action ${{ github.workflow }} **FAILED**! |
| 178 | + Commit: ${{ github.sha }} |
| 179 | + NVidia: ${{ needs.build.outputs.nvidia }} |
| 180 | + <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View failed run> |
0 commit comments