Skip to content

Merge pull request #211 from sustainable-computing-io/dependabot/gith… #69

Merge pull request #211 from sustainable-computing-io/dependabot/gith…

Merge pull request #211 from sustainable-computing-io/dependabot/gith… #69

Workflow file for this run

name: BuildPushDeployImage
on:
push:
branches: [ main ]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'dockerfiles/requirements.txt'
- 'dockerfiles/Dockerfile.base'
- '.github/workflows/build-push.yml'
buildbase:
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay
if: ${{ (github.repository_owner == 'sustainable-computing-io') && (github.ref == 'refs/heads/main') }}
uses: docker/login-action@v3
with:
registry: quay.io/sustainable_computing_io
username: ${{ secrets.BOT_NAME }}
password: ${{ secrets.BOT_TOKEN }}
- name: Build and push base image
uses: docker/build-push-action@v5
with:
context: dockerfiles
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_model_server_base:v0.7
file: dockerfiles/Dockerfile.base
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_model_server:latest,quay.io/sustainable_computing_io/kepler_model_server:v0.7
file: dockerfiles/Dockerfile
build:
needs: [changes]
if: ${{ needs.changes.outputs.src == 'false' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay
if: ${{ (github.repository_owner == 'sustainable-computing-io') && (github.ref == 'refs/heads/main') }}
uses: docker/login-action@v3
with:
registry: quay.io/sustainable_computing_io
username: ${{ secrets.BOT_NAME }}
password: ${{ secrets.BOT_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_model_server:latest,quay.io/sustainable_computing_io/kepler_model_server:v0.7
file: dockerfiles/Dockerfile