name: Build, test, and deploy

on: [push]

jobs:
  build:
    name: Gradle
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11

    - name: Cache Gradle cache
      uses: actions/cache@v1
      with:
        path: ~/.gradle/caches
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
        restore-keys: |
          ${{ runner.os }}-gradle-

    - name: Cache Gradle wrapper
      uses: actions/cache@v1
      with:
        path: ~/.gradle/wrapper
        key: ${{ runner.os }}-gradlew-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
        restore-keys: |
          ${{ runner.os }}-gradlew-

    - name: Build with Gradle
      run: ./gradlew build
      
    - name: Upload jar-file
      uses: actions/upload-artifact@v1
      with:
        name: swoshjar
        path: build/libs/swosh.jar
  docker:
    name: Docker
    runs-on: ubuntu-latest
    needs: build
    steps:
    - uses: actions/checkout@v1
    - name: Download jar-file
      uses: actions/download-artifact@v1
      with:
        name: swoshjar
        path: swosh.jar

    - name: Build Dockerfile
      env:
        REPO: edholm/swosh
      run: |
        pwd
        ls
        VERSION=$(git describe HEAD)
        echo $VERSION
        stat swosh.jar
      shell: bash

name: Build, test, and deploy

on: [push]

jobs:
  build:
    name: Gradle
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11

    - name: Cache Gradle cache
      uses: actions/cache@v1
      with:
        path: ~/.gradle/caches
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
        restore-keys: |
          ${{ runner.os }}-gradle-

    - name: Cache Gradle wrapper
      uses: actions/cache@v1
      with:
        path: ~/.gradle/wrapper
        key: ${{ runner.os }}-gradlew-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
        restore-keys: |
          ${{ runner.os }}-gradlew-

    - name: Build with Gradle
      run: ./gradlew build
      
    - name: Upload jar-file
      uses: actions/upload-artifact@v1
      with:
        name: libs
        path: build/libs/swosh.jar
  docker:
    name: Docker
    runs-on: ubuntu-latest
    needs: build
    steps:
    - uses: actions/checkout@v1
    - name: Download jar-file
      uses: actions/download-artifact@v1
      with:
        name: libs
        path: build/libs/

    - name: Build Dockerfile
      env:
        REPO: edholm/swosh
      run: |
        pwd
        ls
        VERSION=$(git describe HEAD)
        echo $VERSION
        stat build/libs/*
      shell: bash

Correct the paths for the {upload,download} action
Correct the paths for the {upload,download} action
