diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2c0da9b..324d79e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,17 +2,33 @@ name: Docker Image CI on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - + branches: + - main jobs: - - build: - - runs-on: python:3-slim - + docker: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag sungather:$(date +%s) + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/sungather:latest diff --git a/.gitignore b/.gitignore index b77924e..cd33ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,7 @@ dmypy.json # Pyre type checker .pyre/ + +# Intellij IDEA +.idea +*.iml \ No newline at end of file