name: Build & Push Docker image # Builds the stack image (headless Chrome + gpt/gemini extensions + monitor gateway) # on GitHub's runners and pushes it to Docker Hub. No local Docker needed. on: push: branches: [main] paths: - "Dockerfile" - "start_hf.sh" - "monitor/**" - "profilesync/**" - "free-Chatgpt-api/**" - "free-gemini-api/**" - ".github/workflows/docker-publish.yml" workflow_dispatch: {} # allow manual "Run workflow" from the Actions tab env: IMAGE: akashyadav758/free-self-api-server jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile push: true tags: | ${{ env.IMAGE }}:latest ${{ env.IMAGE }}:${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max