File size: 1,041 Bytes
caf7bf2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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