Skip to content

chore(github): fix pr comment #20

chore(github): fix pr comment

chore(github): fix pr comment #20

Workflow file for this run

name: Build
on:
pull_request: {}
push:
branches: [develop, master]
merge_group:
types: [checks_requested]
# develop pushes and repository_dispatch handled in build_develop.yaml
env:
# These must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
permissions: {} # No permissions required
jobs:
build:
name: "Build on ${{ matrix.image }}"
# We build on all 3 platforms to ensure we don't have any OS-specific build incompatibilities
strategy:
fail-fast: false
matrix:
image:
- ubuntu-24.04
# - windows-2022
# - macos-14
isDevelop:
- ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
# Skip the ubuntu-24.04 build for the develop branch as the dedicated CD build_develop workflow handles that
exclude:
- isDevelop: true
image: ubuntu-24.04
runs-on: ${{ matrix.image }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "yarn"
node-version: "lts/*"
# Workaround for yarn install timeouts, especially on Windows
- run: yarn config set network-timeout 300000
- name: Install Dependencies
run: "./scripts/layered.sh"
# - name: Build
# run: "yarn build"
# Build step from develop workflow
- name: Build and Package
run: "./scripts/ci_package.sh"
- run: mv dist/elecord-*.tar.gz dist/elecord.tar.gz
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: webapp
path: dist/elecord.tar.gz
deploy:
needs: build
name: Deploy webapp
runs-on: ubuntu-24.04
steps:
# Download and extract the build folder

Check failure on line 69 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 69
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: webapp
path: .
- name: Extract tarball
run: tar -xvzf elecord.tar.gz
- name: Move to dist
run: mv elecord-*/ dist
# Deploy to Cloudflare using wrangler
- name: Deploy to Cloudflare Pages
id: cf
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=elecord-web --branch=main
# Update PR status comment with deployment URL
- name: Update status comment (Failure)
if: ${{ github.event_name == 'pull_request' && failure() }}
uses: thollander/actions-comment-pull-request@v3
with:
github-token: ${{ secrets.PR_COMMENTS }}
message: |
## Cloudflare Pages deployment
| **Latest commit** | <code>${{ github.event.pull_request.head.sha || github.sha }}</code> |
|-------------------|:-:|
| **Status** | ❌ Failure. Check workflow logs for details |
| **Preview URL** | Not available |
| **Type** | 🔀 Preview |
pr-number: ${{ github.event.pull_request.number }}
comment-tag: CFPages-deployment
mode: recreate
- name: Update status comment (Success)
if: ${{ github.event_name == 'pull_request' && success() }}
uses: thollander/actions-comment-pull-request@v3
with:
github-token: ${{ secrets.PR_COMMENTS }}
message: |
## Cloudflare Pages deployment
| **Latest commit** | <code>${{ github.event.pull_request.head.sha || github.sha }}</code> |
|-------------------|:-:|
| **Status** | ✅ Deployed! |
| **Preview URL** | ${{ steps.cf.outputs.deployment-url != '' && steps.cf.outputs.deployment-url || 'Not available' }} |
| **Type** | 🔀 Preview |
pr-number: ${{ github.event.pull_request.number }}
comment-tag: CFPages-deployment
mode: recreate