This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create application yml | ||
on: workflow_call | ||
workflow_dispatch: | ||
inputs: | ||
application_name: | ||
description: 'The name of the application' | ||
required: true | ||
env: | ||
APPLICATION_NAME: ${{ inputs.application_name }} | ||
jobs: | ||
check-and-create-application-yml: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Check if application.yml exists | ||
id: check_file | ||
uses: andstor/file-existence-action@v3 | ||
with: | ||
files: "./$APPLICATION_NAME/src/main/resources/application.yml" | ||
- name: Create application.yml if it does not exist | ||
if: steps.check_file.outputs.files_exists == 'false' | ||
run: | | ||
touch ./$APPLICATION_NAME/src/main/resources/application.yml | ||
echo "${{ secrets.BACKEND_ENV }}" > ./$APPLICATION_NAME/src/main/resources/application.yml | ||
shell: bash | ||
- name: Perform action if application.yml exists | ||
if: steps.check_file.outputs.files_exists == 'true' | ||
run: | | ||
echo "${{ secrets.BACKEND_ENV }}" > ./$APPLICATION_NAME/src/main/resources/application.yml |