Create docker-image.yml
This commit is contained in:
parent
986e6461ed
commit
caf7bf2b9a
39
.github/workflows/docker-image.yml
vendored
Normal file
39
.github/workflows/docker-image.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Build and push Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
IMAGE_NAME: gpt-academic-nolocal
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Checkout the repository
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Configure Docker Buildx
|
||||||
|
- name: Configure Docker Buildx
|
||||||
|
run: |
|
||||||
|
docker buildx create --name builder
|
||||||
|
docker buildx use builder
|
||||||
|
|
||||||
|
# Set up GitHub Packages registry
|
||||||
|
- name: Set up GitHub Packages registry
|
||||||
|
run: echo "${DOCKER_PASSWORD}" | docker login ghcr.io -u "${DOCKER_USERNAME}" --password-stdin
|
||||||
|
|
||||||
|
# Build and push the Docker image
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
dockerfile: docs/DockerfileNoLocal
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest
|
Loading…
x
Reference in New Issue
Block a user