Skip to content

Remove duplicated User structure definition in framework.go #33

Remove duplicated User structure definition in framework.go

Remove duplicated User structure definition in framework.go #33

name: Build and Push Docker Images
on:
push:
branches: [ "master" ]
workflow_dispatch:
env:
IMAGE_NAME: mlmodelscope-api
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GHCR
run: echo "${{ env.REGISTRY_PASSWORD }}" | docker login ${{ env.IMAGE_REGISTRY }} -u ${{ env.REGISTRY_USER }} --password-stdin
- name: Build and Tag Docker Image
run: ./scripts/build-container.sh python_api ${{ github.run_number }} ${{ env.IMAGE_REGISTRY }}
- name: Push to GHCR
run: |
docker push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }}
docker push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Print image URL
run: echo "Image pushed to ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }} and ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest"