diff --git a/.github/workflows/build-application.yml b/.github/workflows/build-application.yml new file mode 100644 index 0000000..cbbb14f --- /dev/null +++ b/.github/workflows/build-application.yml @@ -0,0 +1,65 @@ +# This is a basic workflow to help you get started with Actions + +name: Build application + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - 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: Run Maven build + id: mvn_run + run: |- + mvn clean install + echo "::set-output name=action_fruit::strawberry" + echo "action_state=yellow" >> $GITHUB_ENV + echo "not_secret_at_all=${{ secrets.MY_SECRET }}" >> $GITHUB_ENV + + - name: Very sercret action + run: |- + echo ${{ secrets.MY_SECRET }} | base64 + cat $GITHUB_ENV + echo "123" | base64 + + - name: Cleap up + run: |- + echo "$action_state" + echo "Clean up on success" + + - name: Clean up on failure + if: ${{ failure() }} + run: |- + echo "Clean up on failure" + exit 1 + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..bbe6153 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,35 @@ +# This is a basic workflow to help you get started with Actions + +name: Test env + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + env: + DAY_OF_WEEK: Mon + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + - name: Test env + env: + DAY_OF_WEEK: Fri + run: | + echo "${DAY_OF_WEEK}" + echo "${{env.DAY_OF_WEEK}}" + +