Skip to content

adding files, refactor and update vertex notebook #34

adding files, refactor and update vertex notebook

adding files, refactor and update vertex notebook #34

Workflow file for this run

name: Build, Test, and Publish
on:
push:
branches:
- main
pull_request:
jobs:
test:
needs: docker-publish
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13]
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Create and activate virtual environment
run: |
python3 -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
pip3 install . -v
- name: Test the package
run: |
source venv/bin/activate
#pytest to come
docker-publish:
runs-on: ubuntu-latest # Docker actions are run on Linux
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Check version changes
run: |
echo $(git diff HEAD~1 HEAD -- ./version) >> ./version
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
./version
- name: Set up Docker Buildx
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.Docker }}
- name: Build and push Docker image
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository }}:latest
- name: Verify the Docker image
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
docker pull ghcr.io/${{ github.repository }}:latest
docker run ghcr.io/${{ github.repository }}:latest