diff --git a/.github/workflows/build-container-image-dev.yml b/.github/workflows/build-container-image-dev.yml new file mode 100644 index 0000000..ac7ed75 --- /dev/null +++ b/.github/workflows/build-container-image-dev.yml @@ -0,0 +1,49 @@ +name: Build and test project + +on: + push: + branches: + - "main" + - "add-docker-image" + +permissions: + contents: read + +jobs: + build: + timeout-minutes: 8 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt-hotspot' + cache: 'gradle' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build project and install Distribution package + uses: gradle/gradle-build-action@v2.2.1 + with: + gradle-version: 'wrapper' + arguments: installDist + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push container image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: scalabot:dev + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file