Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create build-application.yml #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
65 changes: 65 additions & 0 deletions .github/workflows/build-application.yml
Original file line number Diff line number Diff line change
@@ -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

35 changes: 35 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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}}"