diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9f609f4b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Viestinvalityspalvelu + +on: + workflow_dispatch: + push: + paths-ignore: + - '**.md' + +jobs: + test-and-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + + - uses: szenius/set-timezone@v1.0 + with: + timezoneLinux: "Europe/Helsinki" + + - name: Build with Maven + env: + GITHUB_TOKEN: ${{ github.token }} + run: mvn clean verify -B -Dbranch=${GITHUB_REF_NAME} -Drevision=${GITHUB_SHA} -DbuildNumber=${GITHUB_RUN_NUMBER} \ No newline at end of file