2023-02-15 02:53:35 +01:00
|
|
|
name: dockerize
|
2022-01-29 22:31:27 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-02-15 02:53:35 +01:00
|
|
|
tags:
|
|
|
|
- "*"
|
2022-01-29 22:31:27 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2022-08-01 01:30:23 +02:00
|
|
|
paths:
|
2023-02-14 21:50:51 +01:00
|
|
|
- src/khoj/**
|
2022-08-01 01:30:23 +02:00
|
|
|
- config/**
|
2023-02-16 10:12:04 +01:00
|
|
|
- pyproject.toml
|
2022-08-01 01:30:23 +02:00
|
|
|
- Dockerfile
|
|
|
|
- docker-compose.yml
|
2023-02-15 02:53:35 +01:00
|
|
|
- .github/workflows/dockerize.yml
|
2022-09-15 19:28:41 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
DOCKER_IMAGE_TAG: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
|
2022-01-29 22:31:27 +01:00
|
|
|
|
|
|
|
jobs:
|
2022-01-29 23:48:52 +01:00
|
|
|
build:
|
2022-01-29 22:31:27 +01:00
|
|
|
name: Build Docker Image, Push to Container Registry
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
2023-02-18 01:14:46 +01:00
|
|
|
uses: actions/checkout@v3
|
2022-01-29 22:31:27 +01:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2023-02-18 01:14:46 +01:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-01-29 22:31:27 +01:00
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
2023-02-18 01:14:46 +01:00
|
|
|
uses: docker/login-action@v2
|
2022-01-29 22:31:27 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.PAT }}
|
|
|
|
|
2023-03-01 17:56:39 +01:00
|
|
|
- name: 📦 Build and Push Docker Image
|
2022-01-29 22:31:27 +01:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2022-07-04 20:01:59 +02:00
|
|
|
file: Dockerfile
|
2022-01-29 22:31:27 +01:00
|
|
|
push: true
|
2022-09-15 19:28:41 +02:00
|
|
|
tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}
|
2022-01-30 00:04:28 +01:00
|
|
|
build-args: |
|
2023-07-11 05:16:25 +02:00
|
|
|
PORT=42110
|