Skip to content

Commit

Permalink
CI, update WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
danielFlemstrom committed Sep 6, 2024
1 parent 8546c0c commit de525fe
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
name: Build and Push Docker Image
name: Build and Publish Docker Image

on:
workflow_call:
push:
branches:
- main # Trigger on push to the main branch

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Log in to Harbor
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login harbor.main.rise-ck8s.com -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
docker build -t harbor.main.rise-ck8s.com/des-public/tutorials:latest ./tutorials
- name: Log in to Docker registry
env:
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login harbor.main.rise-ck8s.com -u "$DOCKER_USER" --password-stdin
- name: Push Docker image
run: docker push harbor.main.rise-ck8s.com/des-public/tutorials:latest
- name: Build and push Docker image
run: |
docker build -t harbor.main.rise-ck8s.com/des-public/tutorials:latest ./tutorials
docker push harbor.main.rise-ck8s.com/des-public/tutorials:latest
- name: Image digest
run: echo ${{ steps.docker_meta.outputs.digest }}
15 changes: 0 additions & 15 deletions .github/workflows/main.yml

This file was deleted.

32 changes: 21 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
name: Test Docker Image
name: Test Notebooks

on:
workflow_call:
workflow_run:
workflows: ["Build and Publish Docker Image"]
types:
- completed # Trigger only when the build is completed

jobs:
test:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Pull Docker image
run: docker pull harbor.main.rise-ck8s.com/des-public/tutorials:latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Run tests inside Docker container
run: |
docker run --rm \
harbor.main.rise-ck8s.com/des-public/tutorials:latest \
pytest tests/
- name: Log in to Docker registry
env:
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login harbor.main.rise-ck8s.com -u "$DOCKER_USER" --password-stdin
- name: Run notebook tests
run: |
docker pull harbor.main.rise-ck8s.com/des-public/tutorials:latest
docker run --rm harbor.main.rise-ck8s.com/des-public/tutorials:latest pytest --disable-warnings tests/test_notebooks.py

0 comments on commit de525fe

Please sign in to comment.