summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: bf36ba725177f1fd2840942714fe39621477350e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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 13
        uses: actions/setup-java@v1.4.3
        with:
          java-version: 13

      - 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

      - name: Docker push to GitHub Container Registry
        uses: docker/build-push-action@v1
        with:
          path: ./sw-server
          username: ${{ github.actor }}
          password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
          registry: ghcr.io
          repository: joffrey-bion/seven-wonders-server
          tag_with_ref: true
          tag_with_sha: true

      - name: Docker push to DockerHub
        uses: docker/build-push-action@v1
        with:
          path: ./sw-server
          username: hildan
          password: ${{ secrets.DOCKERHUB_TOKEN }}
          repository: hildan/seven-wonders-server
          tag_with_ref: true
          tag_with_sha: true

#     - name: Docker push to GitHub Packages
#       uses: docker/build-push-action@v1
#       with:
#         path: ./sw-server
#         username: ${{ github.actor }}
#         password: ${{ github.token }}
#         registry: docker.pkg.github.com
#         repository: joffrey-bion/seven-wonders/sw-server
#         tag_with_ref: true
#         tag_with_sha: true

#    - name: Docker push to Heroku
#      uses: docker/build-push-action@v1
#      with:
#        path: ./sw-server
#        username: _
#        password: ${{ secrets.HEROKU_API_KEY }}
#        registry: registry.heroku.com
#        repository: seven-wonders-online/web
#        tag_with_ref: true
#        tag_with_sha: true

#    - name: Docker push to Heroku
#      uses: akhileshns/heroku-deploy@v3.0.4
#      with:
#        heroku_api_key: ${{secrets.HEROKU_API_KEY}}
#        heroku_app_name: "seven-wonders-online"
#        heroku_email: ${{secrets.HEROKU_EMAIL}}
#        usedocker: true
#        appdir: "./sw-server"
bgstack15