Skip to content

Commit

Permalink
Add push notification workflow within build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rabilrbl committed Feb 10, 2024
1 parent 48cae92 commit 14269e6
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,31 @@ jobs:
git push origin main
notify:
if: github.ref_name == 'v*'
runs-on: ubuntu-latest
needs: build
uses: ./.github/workflows/notify.yml
with:
release_tag: ${{ needs.build.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # The python version to use.
cache: 'pip'
cache-dependency-path: 'push-notify/requirements.txt'

- name: Install dependencies
run: pip install -r push-notify/requirements.txt

- name: Create google-auth json
run: echo "${{ secrets.GOOGLE_AUTH_JSON }}" | base64 -d > google-services.json

- name: Run push notification script
if: ${{ needs.build.outputs.tag }}
run: |
release_tag="${{ needs.build.outputs.tag }}"
release_body=$(gh release view $release_tag --json body -q .body)
python3 push-notify --title "App update $release_tag" --body "$release_body" --api_url ${{ secrets.NOTIF_API_URL }} --bearer ${{ secrets.NOTIF_API_BEARER }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 14269e6

Please sign in to comment.