Skip to content

Main

Main #192

Workflow file for this run

name: Main
on:
push:
schedule:
- cron: "0 0 * * *"
env:
DOCKER_CONTAINER_NAME: ivangabriele_fastchat
DOCKERHUB_REPOSITORY: ivangabriele/fastchat
DOCKERHUB_USERNAME: ivangabriele
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
VERSION: ["latest"]
VARIANT: ["cuda12"]
env:
DOCKER_ARTIFACT_PATH: ./build/${{ matrix.VERSION }}-${{ matrix.VARIANT }}.tar
DOCKER_IMAGE_TAG: ${{ matrix.VERSION }}-${{ matrix.VARIANT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
docker build -f ./dockerfiles/${{ env.DOCKER_IMAGE_TAG }}.Dockerfile -t ${{ env.DOCKERHUB_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }} .
mkdir -p ./build
docker save -o ./build/${{ env.DOCKER_IMAGE_TAG }}.tar ${{ env.DOCKERHUB_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.DOCKER_IMAGE_TAG }}
path: ${{ env.DOCKER_ARTIFACT_PATH }}
retention-days: 1
release:
name: Release
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
VERSION: ["15"]
VARIANT: [""]
env:
DOCKER_ARTIFACT_PATH: ./build/${{ matrix.VERSION }}-${{ matrix.VARIANT }}.tar
DOCKER_IMAGE_TAG: ${{ matrix.VERSION }}-${{ matrix.VARIANT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.DOCKER_IMAGE_TAG }}
path: ./build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
- name: Push to Docker Hub
run: |
docker load -i ${{ env.DOCKER_ARTIFACT_PATH }}
docker push ${{ env.DOCKERHUB_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }}
- name: Update Docker Hub Readme
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
repository: ${{ env.DOCKERHUB_REPOSITORY }}