Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish all images to ghcr #28

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 72 additions & 6 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
jobs:
base:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -22,11 +25,19 @@ jobs:
with:
username: "${{ vars.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

@brandonjbjelland brandonjbjelland Aug 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following what we did over on the core repo, it'd be good to add a conditional to any login jobs:

Suggested change
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
password: ${{ secrets.GITHUB_TOKEN }}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it to you to either do it here or in follow up 👍

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: substratusai/${{ github.job }}
images: |
substratusai/${{ github.job }}
ghcr.io/${{ github.repository }}/${{ github.job }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@v4
Expand All @@ -40,6 +51,9 @@ jobs:
tag: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
model-trainer-huggingface:
needs: base
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -53,11 +67,19 @@ jobs:
with:
username: "${{ vars.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: substratusai/${{ github.job }}
images: |
substratusai/${{ github.job }}
ghcr.io/${{ github.repository }}/${{ github.job }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@v4
Expand All @@ -72,6 +94,9 @@ jobs:
model-loader-huggingface:
needs: base
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -84,11 +109,19 @@ jobs:
with:
username: "${{ vars.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: substratusai/${{ github.job }}
images: |
substratusai/${{ github.job }}
ghcr.io/${{ github.repository }}/${{ github.job }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@v4
Expand All @@ -103,6 +136,9 @@ jobs:
dataset-squad:
needs: base
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -115,11 +151,19 @@ jobs:
with:
username: "${{ vars.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: substratusai/${{ github.job }}
images: |
substratusai/${{ github.job }}
ghcr.io/${{ github.repository }}/${{ github.job }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@v4
Expand All @@ -132,6 +176,9 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
dataset-loader-http:
permissions:
packages: write
contents: read
needs: base
runs-on: ubuntu-latest
steps:
Expand All @@ -146,11 +193,19 @@ jobs:
with:
username: "${{ vars.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: substratusai/${{ github.job }}
images: |
substratusai/${{ github.job }}
ghcr.io/${{ github.repository }}/${{ github.job }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@v4
Expand All @@ -163,6 +218,9 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
model-server-basaran:
permissions:
packages: write
contents: read
needs: base
runs-on: ubuntu-latest
steps:
Expand All @@ -177,11 +235,19 @@ jobs:
with:
username: "${{ vars.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: substratusai/${{ github.job }}
images: |
substratusai/${{ github.job }}
ghcr.io/${{ github.repository }}/${{ github.job }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@v4
Expand Down