Skip to content

Update deploy.yml

Update deploy.yml #102

Workflow file for this run

name: CI
on:
# Triggers the workflow on push events but only for the master branch
push:
branches:
- main
- deploy
## Allows you to run this workflow manually from the Actions tab
#workflow_dispatch:
# inputs:
# version:
# description: 'Image version'
# required: true
env:
REGISTRY: ghcr.io
NAMESPACE: mpjunot/copyme
TAG: latest
IMAGE_BACKEND: copyme-backend-api
jobs:
build_and_push:
name: Push Docker image to Docker Registry
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
#- name: Download copyme.pt from release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# RELEASE_URL=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/releases/latest \
# | jq -r '.assets[] | select(.name == "copyme.pt") | .browser_download_url')
#
# if [ -z "$RELEASE_URL" ]; then
# echo "Error: Could not find copyme.pt in the latest release assets."
# exit 1
# fi
#
# mkdir -p ./src/model/
# curl -L "$RELEASE_URL" -o ./src/models/copyme.pt
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
#- name: Create .env file
# uses: SpicyPizza/create-envfile@v1
# with:
# envkey_MONGO_ROOT_PASSWORD: ${{ secrets.MONGO_ROOT_PASSWORD }}
# envkey_MONGO_ROOT_USERNAME: ${{ secrets.MONGO_ROOT_USERNAME }}
# file_name: .env
- name: Build and push Docker orchestrator-service image
uses: docker/build-push-action@v3
with:
context: ./copyme-ai/
file: ./src/pre-prod.dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_BACKEND }}:${{ env.TAG }}