π Deploy #36
This file contains hidden or 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: π Deploy | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| APP_VARIANT: | |
| description: "App variant to deploy" | |
| required: true | |
| default: "internal" | |
| type: choice | |
| options: | |
| - internal | |
| - production | |
| env: | |
| CI: true | |
| APP_VARIANT: ${{ github.event.inputs.APP_VARIANT }} | |
| GRAPHQL_URL: ${{ github.event.inputs.APP_VARIANT == 'production' && 'https://api.democracy-app.de' || 'https://internal.api.democracy-app.de' }} | |
| jobs: | |
| build: | |
| name: Build & Deploy ${{ matrix.platform }} | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: android | |
| os: ubuntu-latest | |
| - platform: ios | |
| os: macos-latest | |
| xcode: "latest-stable" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Set up Node.js with pnpm | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Select Xcode ${{ matrix.xcode }} | |
| if: ${{ matrix.platform == 'ios' }} | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: ${{ matrix.xcode }} | |
| - name: iOS Encrypt GPG secure files | |
| if: ${{ matrix.platform == 'ios' }} | |
| run: | | |
| brew install [email protected] | |
| echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 google-services.json.gpg | |
| echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 deploy/ios/AuthKey_3Q9U495BMY.p8.gpg | |
| - name: Android Encrypt GPG secure files | |
| if: ${{ matrix.platform == 'android' }} | |
| run: | | |
| sudo apt-get install -y gnupg1 | |
| echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 google-services.json.gpg | |
| echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 deploy/android/key.json.gpg | |
| echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 deploy/android/democracy2-release-key.keystore.gpg | |
| - name: Build Expo app prebuild for ${{ matrix.platform }} | |
| run: pnpm expo prebuild | |
| - name: iOS Fastlane | |
| if: ${{ matrix.platform == 'ios' }} | |
| run: | | |
| fastlane ios deploy --env ${{ github.event.inputs.APP_VARIANT }} | |
| working-directory: ${{ github.workspace }}/deploy/ios | |
| env: | |
| MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | |
| FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| MATCH_TYPE: appstore | |
| MATCH_FORCE: "true" | |
| FASTLANE_TEAM_ID: A4B84UJD7M | |
| - name: Setup Ruby + Cache Gems | |
| uses: ruby/setup-ruby@v1 | |
| if: ${{ matrix.platform == 'android' }} | |
| with: | |
| bundler-cache: true | |
| working-directory: deploy/android | |
| - name: Android Fastlane | |
| if: ${{ matrix.platform == 'android' }} | |
| run: | | |
| bundle exec fastlane android internal --env ${{ github.event.inputs.APP_VARIANT }} | |
| working-directory: ${{ github.workspace }}/deploy/android | |
| env: | |
| MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | |
| FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| ANDROID_PASS: ${{ secrets.ANDROID_PASS }} | |
| ANDROID_PROJECT_PATH: ${{ github.workspace }} |