diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..9d43a13 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,48 @@ +name: Deploy + +on: + push: + branches: + - main + +env: + REGISTRY: ghcr.io + +jobs: + bot_image: + name: Build and Push Docker Image + runs-on: ubuntu-latest + steps: + - name: Setup | Buildx + uses: docker/setup-buildx-action@v2 + + - name: Setup | Checkout + uses: actions/checkout@v2 + + - name: Setup | Login to GHCR + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build | Extract Metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/bunnybots-2023-ml + tags: | + type=sha + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + + - name: Build | Build and Push + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file