name: Docker on: pull_request: branches: - main push: branches: - main tags: - v* schedule: - cron: '0 16 * * *' # Every day at 16:00 UTC (~09:00 PT) jobs: # Push container image to GitHub Packages and Docker Hub. # See also https://docs.docker.com/docker-hub/builds/ deploy: name: Docker image build runs-on: ubuntu-latest env: DOCKER_BUILDKIT: 1 DOCKER_CLI_EXPERIMENTAL: enabled steps: - name: Checkout code uses: nschloe/action-cached-lfs-checkout@v1.1.3 with: exclude: "scoutbot/*/models/pytorch/" - uses: docker/setup-qemu-action@v1 name: Set up QEMU id: qemu with: image: tonistiigi/binfmt:latest platforms: all - uses: docker/setup-buildx-action@v1 name: Set up Docker Buildx id: buildx - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} # Log into container registries - name: Login to DockerHub uses: docker/login-action@v1 with: username: wildmebot password: ${{ secrets.WBIA_WILDMEBOT_DOCKER_HUB_TOKEN }} # Push tagged image (version tag + latest) to registries - name: Tagged Docker Hub if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} run: | echo "IMAGE_TAG=latest" >> $GITHUB_ENV # Push bleeding-edge image (main tag) to registries - name: Bleeding Edge Docker Hub if: github.ref == 'refs/heads/main' run: | echo "IMAGE_TAG=main" >> $GITHUB_ENV # Push nightly image (nightly tag) to registries - name: Nightly Docker Hub if: github.event_name == 'schedule' run: | echo "IMAGE_TAG=nightly" >> $GITHUB_ENV # Build images - name: Build Codex run: | docker buildx build \ -t wildme/scoutbot:${{ env.IMAGE_TAG }} \ -t wildme/scoutbot:latest \ --platform linux/amd64 \ --push \ .