diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..11c54a4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: deploy + +on: + push: + branches: + - master + workflow_dispatch: + +env: + REGISTRY: ghcr.io + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Push API image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: 'ghcr.io/brownknight/grid-battle:latest' + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/arm64 + + - name: Build and Push Importer image + uses: docker/build-push-action@v6 + with: + context: . + file: "./server/GridBattle.Data.Importer/Dockerfile" + push: true + tags: 'ghcr.io/brownknight/grid-battle-importer:latest' + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/arm64 \ No newline at end of file