diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..2e98caa --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,44 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + - test-docker-build + workflow_dispatch: # Allow manual triggering + +jobs: + build-and-push: + name: Build and Push Docker Image + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,amd64' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: .container/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + mugglejinx/owl:latest + mugglejinx/owl:${{ github.sha }} + cache-from: type=registry,ref=mugglejinx/owl:buildcache + cache-to: type=registry,ref=mugglejinx/owl:buildcache,mode=max \ No newline at end of file