Skip to content

Commit

Permalink
ci: build and push images on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Feb 21, 2024
1 parent c64ebd8 commit 8daa0df
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Release
on:
pull_request:
types:
- closed
branches:
- main
types: [opened, synchronize, closed]
branches: [main]

env:
TUTOR_ROOT: ./.ci/
Expand Down Expand Up @@ -46,6 +44,7 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}

build-aspects:
runs-on: ubuntu-latest
needs: release
Expand All @@ -57,6 +56,12 @@ jobs:
password: ${{ secrets.EDUNEXT_DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v4
- name: Extract Commit Hash
id: extract_commit_hash
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Update ASPECTS_VERSION
run: |
sed -i 's/ASPECTS_VERSION: .*/ASPECTS_VERSION: ${{ steps.extract_commit_hash.outputs.hash }}/' .ci/config.yml
- name: setup python
uses: actions/setup-python@v5
with:
Expand All @@ -71,6 +76,7 @@ jobs:
run: |
tutor images build aspects --cache-to-registry
tutor images push aspects
build-superset:
runs-on: ubuntu-latest
needs: release
Expand All @@ -82,6 +88,10 @@ jobs:
password: ${{ secrets.EDUNEXT_DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v4
- name: Update ASPECTS_VERSION
run: |
ASPECTS_VERSION=$(git rev-parse --short HEAD)
sed -i "s/ASPECTS_VERSION: .*/ASPECTS_VERSION: $ASPECTS_VERSION/" .ci/config.yml
- name: setup python
uses: actions/setup-python@v5
with:
Expand All @@ -96,6 +106,7 @@ jobs:
run: |
tutor images build aspects-superset --cache-to-registry
tutor images push aspects-superset
build-openedx:
runs-on: ubuntu-latest
needs: release
Expand All @@ -107,6 +118,10 @@ jobs:
password: ${{ secrets.EDUNEXT_DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v4
- name: Update ASPECTS_VERSION
run: |
ASPECTS_VERSION=$(git rev-parse --short HEAD)
sed -i "s/ASPECTS_VERSION: .*/ASPECTS_VERSION: $ASPECTS_VERSION/" .ci/config.yml
- name: setup python
uses: actions/setup-python@v5
with:
Expand All @@ -133,6 +148,10 @@ jobs:
password: ${{ secrets.EDUNEXT_DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v4
- name: Update ASPECTS_VERSION
run: |
ASPECTS_VERSION=$(git rev-parse --short HEAD)
sed -i "s/ASPECTS_VERSION: .*/ASPECTS_VERSION: $ASPECTS_VERSION/" .ci/config.yml
- name: setup python
uses: actions/setup-python@v5
with:
Expand All @@ -145,4 +164,4 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build Open edX Docker Images
run: |
tutor images build openedx-dev --cache-to-registry
tutor images build openedx-dev --cache-to-registry

0 comments on commit 8daa0df

Please sign in to comment.