Android deployment using Fastlane but only on Tag push

Hi,

I’m new to Travis-ci and I got my Android deployment all setup without conditions. Now I want to make sure deployment only happens when a certain tag is pushed, but I can’t seem to figure out how this is suppose to work (no examples I could find and documentation isn’t very clear on it)? I’ve added my yml file below, can anyone help me out? Also, using this script deployment of a simple Android app takes ± 10 minutes. Is there a way to speed this up (maybe using a different docker image or something)?

language: android
sudo: required
jdk: oraclejdk8

env:
  global:
  - ANDROID_API_LEVEL=28
  - ANDROID_BUILD_TOOLS_VERSION=28.0.3
  - ANDROID_ABI=armeabi-v7a

android:
  components:
    - tools
    - platform-tools
    - tools
    - extra-android-m2repository
  licenses:
    - 'android-sdk-preview-license-52d11cd2'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

before_install:
  - touch $HOME/.android/repositories.cfg
  - yes | sdkmanager "platforms;android-28"
  - yes | sdkmanager "build-tools;28.0.3"
  - cd Android/GitViewer
  - gem update --system
  - gem install fastlane --quiet
  - gem install travis-conditions
  - bundle install
  - bundle update

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
  - $HOME/.gradle/caches/
  - $HOME/.gradle/wrapper/
  - $HOME/.android/build-cache

before_script:
  - cd $TRAVIS_BUILD_DIR/Android/GitViewer
  - chmod +x gradlew

script:
  -./gradlew dokka

deploy:
  # Deploy a Staging version when Fabric/Staging tag is pushed
  - provider: script
    script: bundle exec fastlane deploy_staging
    on:
      tags: true
      conditions: "$TRAVIS_TAG =~ (?:Fabric\/Staging)"

  # Deploy a Production version when Fabric/Production tag is pushed
  - provider: script
    script: bundle exec fastlane deploy_production
    on:
      tags: true
      conditions: "$TRAVIS_TAG =~ (?:Fabric\/Production)"

  # Deploy a Production version to the Google Play Store
  - provider: script
    script: bundle exec fastlane deploy_play_store
    on: 
      tags: true
      conditions: $TRAVIS_TAG =~ (?:GooglePlayStore)


# jobs:
#   include:
#     - stage: deploy_staging
#       script: bundle exec fastlane deploy_staging
#     - stage: deploy_production
#       script: bundle exec fastlane deploy_production
#     - stage: deploy_playstore
#       script: bundle exec fastlane deploy_play_store
    
# stages:
#   - name: deploy_staging
#     deploy:
#       on:
#         tags: true
#         condition: "$TRAVIS_TAG =~ (?:Fabric\/Staging)"
#   - name: deploy_production
#     deploy:
#       on:
#         tags: true
#         condition: "$TRAVIS_TAG =~ (?:Fabric\/Production)"
#   - name: deploy_playstore
#     deploy:
#       on:
#         tags: true
#         condition: "$TRAVIS_TAG =~ (?:Fabric\/Production)"

Actually I just figured out that the code above is working! But it’s not showing up on the Travis dashboard when it’s running. However I do get a slack notification that the build is succeeded and uploaded to Fabric.

Any idea why this is not showing up on the Travis dashboard as a running job?

When reporting problems, please include relevant build URLs. Thanks.

Imprint