Skip to content

Commit

Permalink
Merge pull request #3 from learningequality/rtibbles-patch-1
Browse files Browse the repository at this point in the history
Build image on PRs
  • Loading branch information
rtibbles authored Nov 6, 2024
2 parents 655ed7d + 0f86208 commit 7c6151b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Pi image for PRs

on:
pull_request:
branches:
- main

jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
latest_kolibri_release:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
deb-url: ${{ steps.get_latest_kolibri_release.outputs.result }}
steps:
- name: Get latest Kolibri release
id: get_latest_kolibri_release
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { data: releases } = await github.rest.repos.listReleases({
owner: 'learningequality',
repo: 'kolibri',
per_page: 1,
page: 1,
});
const latestRelease = releases[0];
const debAsset = latestRelease.assets.find(asset => asset.name.endsWith('.deb'));
const debUrl = debAsset.browser_download_url;
return debUrl;
build_img:
name: Build Image
needs: [pre_job, latest_kolibri_release]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: ./.github/workflows/build_img.yml
with:
deb-url: ${{ needs.latest_kolibri_release.outputs.deb-url }}

0 comments on commit 7c6151b

Please sign in to comment.