Skip to content

CD

CD #623

Workflow file for this run

name: CD
on:
workflow_dispatch:
inputs:
flavour:
type: choice
description: App flavour
options:
- pre-alpha
- alpha
- beta
- release
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.inputs.flavour }}
cancel-in-progress: ${{ github.event.inputs.flavour == 'release' }}
jobs:
testFlightDeploy:
permissions:
id-token: write
contents: read
name: "Test Flight Deploy"
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' && !(contains(github.event.head_commit.message, '[skip cd]') || contains(github.event.head_commit.message, '[cd skip]')) }}
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Configure AWS credentials to fetch secrets
uses: aws-actions/configure-aws-credentials@97271860067ec931c45b8d104fbf0d15954ab85c # branch v1-node16
with:
role-to-assume: ${{ secrets.GH_WALLET_SECRET_ACCESS }}
aws-region: "eu-west-2"
role-session-name: 'babylon-wallet-ios-${{ github.run_id }}-${{ github.run_attempt }}'
- name: Fetch AWS secrets
uses: aws-actions/aws-secretsmanager-get-secrets@287592d14d9c9c48199db83dc182ae12af3df18e # v1.0.1
with:
secret-ids: |
WALLET, ${{ secrets.AWS_SECRET_NAME_WALLET }}
parse-json-secrets: true
- name: Fetch AWS secrets
uses: aws-actions/aws-secretsmanager-get-secrets@287592d14d9c9c48199db83dc182ae12af3df18e # v1.0.1
with:
secret-ids: |
SWIFT_SSH, ${{ secrets.AWS_SECRET_NAME_WALLET_SWIFT_SSH }}
parse-json-secrets: true
- name: Fetch AWS secrets
uses: aws-actions/aws-secretsmanager-get-secrets@287592d14d9c9c48199db83dc182ae12af3df18e # v1.0.1
with:
secret-ids: |
FASTLANE_MATCH_REPO_SSH_KEY, ${{ secrets.AWS_SECRET_NAME_WALLET_FASTLANE_SSH }}
parse-json-secrets: true
- name: Fetch webhook AWS secrets
uses: aws-actions/aws-secretsmanager-get-secrets@287592d14d9c9c48199db83dc182ae12af3df18e # v1.0.1
with:
secret-ids: |
WEBHOOK, ${{ secrets.AWS_SECRET_NAME_SLACK_WEBHOOK }}
parse-json-secrets: true
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ env.SWIFT_SSH }}
${{ env.FASTLANE_MATCH_REPO_SSH_KEY }}
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
token: ${{ env.WALLET_RADIX_BOT_PAT }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.0"
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ env.SWIFT_SSH }}
${{ env.FASTLANE_MATCH_REPO_SSH_KEY }}
- name: Config local env
run: |
git config user.name $GIT_USER
git config user.email $GIT_USER
echo "${{ env.WALLET_FASTLANE_SECRETS_BASE64 }}" | base64 --decode > fastlane/.env.secret
brew install xcbeautify
env:
GIT_USER: ${{ env.WALLET_RADIX_BOT_USERNAME }}
- name: "Deploy"
run: |
FLAVOUR=alpha
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]
then
FLAVOUR=${{ github.event.inputs.flavour }}
fi
bundle exec fastlane deploy --env ios.$FLAVOUR
env:
GIT_TOKEN: ${{ env.WALLET_RADIX_BOT_PAT }}
SLACK_WEBHOOK_URL: ${{ env.WEBHOOK_SLACK_URL }}