|
| 1 | +name: Deploy to Firebase Beta |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ master, release* ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + bump-version: |
| 9 | + name: Bump version code |
| 10 | + runs-on: ubuntu-latest |
| 11 | + outputs: |
| 12 | + version_code: ${{ steps.bump.outputs.version_code }} |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + ref: ${{ github.head_ref || github.ref }} |
| 19 | + fetch-depth: 0 |
| 20 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + |
| 22 | + - name: Bump version code |
| 23 | + id: bump |
| 24 | + uses: ./.github/workflows/actions/bump-version |
| 25 | + with: |
| 26 | + branch: ${{ github.head_ref || github.ref_name }} |
| 27 | + |
| 28 | + build: |
| 29 | + name: Build beta APK |
| 30 | + needs: bump-version |
| 31 | + uses: ./.github/workflows/build.yml |
| 32 | + with: |
| 33 | + build_variant: beta |
| 34 | + upload_artifact: true |
| 35 | + secrets: inherit |
| 36 | + |
| 37 | + deploy: |
| 38 | + name: Deploy to Firebase |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: [bump-version, build] |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout code |
| 44 | + uses: actions/checkout@v4 |
| 45 | + with: |
| 46 | + ref: master |
| 47 | + |
| 48 | + - name: Download APK artifact |
| 49 | + uses: actions/download-artifact@v4 |
| 50 | + with: |
| 51 | + name: app-beta |
| 52 | + |
| 53 | + - name: Deploy to Firebase App Distribution |
| 54 | + uses: wzieba/Firebase-Distribution-Github-Action@v1 |
| 55 | + with: |
| 56 | + appId: 1:422699885542:android:aab16ef8fc4e5968a0ec27 |
| 57 | + serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} |
| 58 | + groups: Greenstand |
| 59 | + releaseNotes: "A new release! Build ${{ needs.bump-version.outputs.version_code }}" |
| 60 | + file: app-beta-release.apk |
| 61 | + |
| 62 | +# notify: |
| 63 | +# name: Send Slack notifications |
| 64 | +# runs-on: ubuntu-latest |
| 65 | +# needs: [bump-version, deploy] |
| 66 | +# if: success() |
| 67 | +# |
| 68 | +# steps: |
| 69 | +# - name: Get git branch |
| 70 | +# id: git-branch |
| 71 | +# run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT |
| 72 | +# |
| 73 | +# - name: Send Slack notification (main) |
| 74 | +# uses: slackapi/slack-github-action@v1 |
| 75 | +# with: |
| 76 | +# payload: | |
| 77 | +# { |
| 78 | +# "text": "A new Greenstand Beta Build has been released on Firebase", |
| 79 | +# "blocks": [ |
| 80 | +# { |
| 81 | +# "type": "section", |
| 82 | +# "text": { |
| 83 | +# "type": "mrkdwn", |
| 84 | +# "text": "A new Greenstand Beta Build has been released on Firebase\n*Build Number:* ${{ needs.bump-version.outputs.version_code }}\n*Branch:* ${{ steps.git-branch.outputs.branch }}" |
| 85 | +# } |
| 86 | +# } |
| 87 | +# ] |
| 88 | +# } |
| 89 | +# env: |
| 90 | +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_URL }} |
| 91 | +# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
| 92 | +# |
| 93 | +# - name: Send Slack notification (QC) |
| 94 | +# uses: slackapi/slack-github-action@v1 |
| 95 | +# with: |
| 96 | +# payload: | |
| 97 | +# { |
| 98 | +# "text": "A new Greenstand Beta Build has been released on Firebase", |
| 99 | +# "blocks": [ |
| 100 | +# { |
| 101 | +# "type": "section", |
| 102 | +# "text": { |
| 103 | +# "type": "mrkdwn", |
| 104 | +# "text": "A new Greenstand Beta Build has been released on Firebase\n*Build Number:* ${{ needs.bump-version.outputs.version_code }}\n*Branch:* ${{ steps.git-branch.outputs.branch }}" |
| 105 | +# } |
| 106 | +# } |
| 107 | +# ] |
| 108 | +# } |
| 109 | +# env: |
| 110 | +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_URL_QC }} |
| 111 | +# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
0 commit comments