ci: Base64 decode SSH key for reliable newline handling #5
Workflow file for this run
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: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - improvement/fastlane-deployment # TEMP: remove after testing | |
| jobs: | |
| deploy-ios: | |
| name: Build and Deploy iOS | |
| runs-on: macos-latest | |
| timeout-minutes: 45 | |
| defaults: | |
| run: | |
| working-directory: example | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| working-directory: example | |
| - run: flutter pub get | |
| - name: Setup SSH keys for fastlane match | |
| run: | | |
| SSH_PATH="$HOME/.ssh" | |
| mkdir -p "$SSH_PATH" | |
| touch "$SSH_PATH/known_hosts" | |
| echo "$PRIVATE_KEY" | base64 --decode > "$SSH_PATH/id_rsa" | |
| chmod 700 "$SSH_PATH" | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| chmod 600 "$SSH_PATH/known_hosts" | |
| chmod 600 "$SSH_PATH/id_rsa" | |
| eval $(ssh-agent) | |
| ssh-add "$SSH_PATH/id_rsa" | |
| env: | |
| PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Deploy to App Store | |
| run: bundle exec fastlane ios deploy | |
| env: | |
| TEAM_ID: ${{ secrets.TEAM_ID }} | |
| ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }} | |
| FASTLANE_USER: ${{ secrets.FASTLANE_USER }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }} | |
| MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} | |
| MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} | |
| APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }} | |
| APPSTORE_KEY_ISSUER_ID: ${{ secrets.APPSTORE_KEY_ISSUER_ID }} | |
| APPSTORE_KEY_CONTENT: ${{ secrets.APPSTORE_KEY_CONTENT }} |