name: CI Build on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up JDK 15 uses: actions/setup-java@v1.4.3 with: java-version: 15 - name: Gradle build cache uses: actions/cache@v2.1.1 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*') }} restore-keys: ${{ runner.os }}-gradle-build- - name: Gradle wrapper cache uses: actions/cache@v2.1.1 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }} - name: Build with Gradle run: ./gradlew build # technically optional, brings support for more platform to Docker Buildx - name: Set up QEMU uses: docker/setup-qemu-action@v1 # required for Docker build/push - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 with: username: hildan password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} - name: Login to Heroku Container Registry uses: docker/login-action@v1 with: registry: registry.heroku.com username: ${{ secrets.HEROKU_EMAIL }} password: ${{ secrets.HEROKU_API_KEY }} - name: Build and push to DockerHub and GitHub Container Registry uses: docker/build-push-action@v2 with: context: ./sw-server file: ./sw-server/Dockerfile push: true tags: | hildan/seven-wonders-server:latest ghcr.io/joffrey-bion/seven-wonders-server:latest registry.heroku.com/seven-wonders-online/web