ci: Working on CI/CD #10
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
name: CI/CD Workflow | |
on: | |
push: | |
branches: | |
- 178-schedule-abi-using-github-action | |
pull_request: | |
branches: | |
- 178-schedule-abi-using-github-action | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
run: | | |
make build | |
docker tag abi:latest ghcr.io/${{ github.repository }}/abi:latest | |
- name: Push Docker image to GitHub Container Registry | |
run: docker push ghcr.io/${{ github.repository }}/abi:latest | |
- name: Run Papermill | |
run: docker run --rm --platform linux/amd64 ghcr.io/${{ github.repository }}/abi:latest papermill tests/ci.ipynb outputs/ci.output.ipynb | |
- name: Upload output artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: output-files | |
path: ./outputs | |
# jobs: | |
# pull_and_run: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v4 | |
# - name: Log in to GitHub Container Registry | |
# uses: docker/login-action@v3 | |
# with: | |
# registry: ghcr.io | |
# username: ${{ github.actor }} | |
# password: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Pull Docker image | |
# run: docker pull ghcr.io/${{ github.repository }}/abi:latest | |
# - name: Run Papermill | |
# run: | | |
# docker run --name abi-execution -i --platform linux/amd64 ghcr.io/${{ github.repository }}/abi:latest papermill tests/ci.ipynb outputs/ci.ipynb | |
# mkdir outputs | |
# docker cp -r abi-execution:/app/outputs ./outputs/ | |
# - name: Upload output artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: output-files | |
# path: ./outputs |