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/**
|
2022-08-03 10:56:40 +02:00
|
|
|
- setup.py
|
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
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.PAT }}
|
|
|
|
|
|
|
|
- name: Build and Push Docker Image
|
|
|
|
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: |
|
|
|
|
PORT=8000
|