diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15f9d1e0..7bbed8a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,27 @@ jobs: permissions: contents: read deployments: write + pull-requests: write steps: - uses: actions/checkout@v4 with: submodules: recursive + - name: Comment deploy start + if: github.event_name != 'push' + uses: mshick/add-pr-comment@v2 + with: + message-id: cloudflare-deploy + message: | + ### Deploy Preview building... + + | Name | Link | + |---------------------------------|------------------------| + | Latest commit | ${{ github.sha }} | + | Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | + --- + - name: Setup rust toolchain uses: dtolnay/rust-toolchain@stable with: @@ -59,6 +74,7 @@ jobs: - name: Publish to Cloudflare Pages uses: cloudflare/pages-action@v1 + id: cloudflare-publish with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} @@ -66,3 +82,19 @@ jobs: directory: dist workingDirectory: app/gameboy wranglerVersion: "3" + + - name: Comment deploy url + uses: mshick/add-pr-comment@v2 + with: + message-id: cloudflare-deploy + message: | + ### Deploy Preview ready! + + + | Name | Link | + |---------------------------------|------------------------| + | Latest commit | ${{ github.sha }} | + | Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | + | Deploy Preview Url | [${{ steps.cloudflare.outputs.url }}](${{ steps.cloudflare.outputs.url }}) | + | Environment | ${{ steps.cloudflare.outputs.environment }} | + ---