From d22b59306a4608a9247567d3bcc873f63d2e9bf9 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Wed, 9 Oct 2024 22:08:36 +0300 Subject: [PATCH] Create json --- .github/workflows/create-service-json.yml | 27 +++++++++++++++++++++++ .github/workflows/deploy.yml | 7 +++++- .github/workflows/run_tests.yml | 7 ++---- .github/workflows/tests.yml | 23 +++++++++++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/create-service-json.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/create-service-json.yml b/.github/workflows/create-service-json.yml new file mode 100644 index 0000000..7c5ff5b --- /dev/null +++ b/.github/workflows/create-service-json.yml @@ -0,0 +1,27 @@ +name: Create Release Notes + +on: + # Enables this workflow to be called from other workflows + workflow_call: + +jobs: + create-release-notes: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Create Google Service JSON + run: | + echo "${{ secrets.GOOGLE_SERVICE_JSON }}" > \ + ${{ github.workspace }}/app/google-services.json | base64 + + - name: Check Google Service JSON file is created + run: | + if [ -f ./app/google-services.json ]; then + echo "google-services.json exists." + else + echo "google-services.json does not exist." >&2 + exit 1 + fi + continue-on-error: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cd88a53..1bf3e1d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,9 +14,14 @@ jobs: uses: ./.github/workflows/create-release-notes.yml secrets: inherit + create-service-json: + uses: ./.github/workflows/create-service-json.yml + needs: create-release-notes + secrets: inherit + build-signed-bundle: uses: ./.github/workflows/build-signed-bundle.yml - needs: create-release-notes + needs: create-service-json secrets: inherit create-github-release: diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 2006f86..6ccb8f1 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -2,11 +2,8 @@ name: Run Unit Tests # Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + # Enables this workflow to be called from other workflows + workflow_call: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..16bd01a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +name: Run Tests + +on: + + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main", "improve-actions" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + create-service-json: + uses: ./.github/workflows/create-service-json.yml + secrets: inherit + + run-tests: + uses: ./.github/workflows/run-tests.yml + needs: create-service-json + secrets: inherit