diff --git a/.dockerignore b/.dockerignore index 53ecbed..c48e5a4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ .env .mockery.yaml -configs/secrets* \ No newline at end of file +configs/secrets* diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 0000000..a533371 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,39 @@ +name: Docker Release + +on: + release: + types: [published] + workflow_dispatch: + +env: + DOCKER_IMAGE: thirdweb/indexer + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.DOCKER_IMAGE }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 34b0a6a..0c05b7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,4 @@ EXPOSE 8080 ENTRYPOINT ["/bin/app"] -CMD [] \ No newline at end of file +CMD []