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

NOISSUE - Create and publish a Docker image #29

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) Ultraviolet
# SPDX-License-Identifier: Apache-2.0

name: Create and publish a Docker image

on:
push:
branches: ["main"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dborovcanin marked this conversation as resolved.
Show resolved Hide resolved

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build API Gateway and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
build-args: |
SVC=manager
tags: ghcr.io/ultravioletrs/cocos/manager:latest
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define make_docker
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg TIME=$(TIME) \
--tag=cocos-ai/$(svc) \
--tag=ghcr.io/ultravioletrs/cocos/$(svc) \
-f docker/Dockerfile .
endef

Expand All @@ -45,7 +45,7 @@ define make_docker_dev
docker build \
--no-cache \
--build-arg SVC=$(svc) \
--tag=cocos-ai/$(svc) \
--tag=ghcr.io/ultravioletrs/cocos/$(svc) \
-f docker/Dockerfile.dev ./build
endef

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
networks:
- cocos-base-net
cocos-manager:
image: cocos-ai/manager:latest
image: ghcr.io/ultravioletrs/cocos/manager:latest
container_name: cocos-manager
env_file:
- .env
Expand Down
Loading