GCP Classroom notes 27/Nov/2024

Github expressions

Conditions in Github actions

loops

  • View the following workflow
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven

name: Java CI with Maven

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java-version: [ '17', '21' ]
    steps:
      - name: Print Github Context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: "echo ${GITHUB_CONTEXT}"
      - uses: actions/checkout@v4
      - name: Set up JDK ${{ matrix.java-version }}
        uses: actions/setup-java@v4
        with:
          java-version: ${{ matrix.java-version }}
          distribution: 'adopt'
          cache: maven
      - name: Build with Maven Wrapper
        run: ./mvnw package

Github workflow triggers

Continuous Integration


* Watch classroom recording for codeql scans
* Exercise: Try setting up a sonar cloud workflow with your public springpetclinic

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers
Exit mobile version
%%footer%%