-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new GitHub Actions job to create google-services.json dynamic…
…ally (#26) * Create json * Fixed a workflow name * Upload to artifacs and delet from artifacts * Remove artifacts even if a previous job is failed * Download service json * Echo json * Check json from secret * Check json from secret * Check json from secret * Last change * Trigger changes in master only
- Loading branch information
1 parent
e47486b
commit da1ea2c
Showing
7 changed files
with
114 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Clean up artifacts | ||
|
||
on: | ||
# Enables this workflow to be called from other workflows | ||
workflow_call: | ||
|
||
jobs: | ||
remove-artifacs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: geekyeggo/delete-artifact@v5 | ||
with: | ||
name: | | ||
bundles | ||
release_notes | ||
google_service_json | ||
failOnError: false | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Create Google Service JSON | ||
|
||
on: | ||
# Enables this workflow to be called from other workflows | ||
workflow_call: | ||
|
||
jobs: | ||
create-service-json: | ||
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 | ||
|
||
- name: Upload to artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: google_service_json | ||
path: ${{ github.workspace }}/app/google-services.json | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Run Tests | ||
|
||
on: | ||
|
||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main" ] | ||
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 | ||
|
||
# It allow to remove artifacts created to use between workflows (google service json, bundles, etc) | ||
remove-artifacts: | ||
uses: ./.github/workflows/clean-up-artifacts.yml | ||
needs: run-tests | ||
# Run this job even if "needs" job is failed | ||
if: ${{ always() && contains(needs.*.result, 'failure') }} | ||
secrets: inherit |
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