-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8546c0c
commit de525fe
Showing
3 changed files
with
44 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |