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