Generate daily snapshot #1604
This file contains 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: Generate daily snapshot | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '00 0 * * *' | |
workflow_dispatch: | |
jobs: | |
cancel_previous: | |
name: Cancel previous runs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
generate_daily_snapshot: | |
name: Generate daily snapshot from develop | |
runs-on: ubuntu-latest | |
needs: cancel_previous | |
steps: | |
- name: Checkout develop | |
uses: actions/checkout@v3 | |
with: | |
ref: develop | |
fetch-depth: 0 # Whole repo history | |
- name: Check if there has been new commits in the last 24 hours | |
id: check-new-commits | |
uses: adriangl/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: develop | |
seconds: 86400 # one day | |
- name: Cancel job if no new commits have been found in the last 24 hours | |
if: ${{ steps.check-new-commits.outputs.has-new-commits != 'true' }} | |
uses: andymckay/[email protected] | |
- name: Fetch all tags | |
run: git fetch origin +refs/tags/*:refs/tags/* | |
- name: Install fastlane-plugin-android_build_tools deploy key | |
uses: shimataro/[email protected] | |
with: | |
key: ${{ secrets.ANDROID_BUILD_TOOLS_DEPLOY_KEY }} | |
name: id_rsa | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Set-up and configure JDK 11 | |
uses: actions/[email protected] | |
with: | |
distribution: zulu | |
java-version: 11 | |
cache: gradle | |
- name: Set-up and configure Ruby | |
uses: ruby/[email protected] | |
with: | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Install keysafe deploy key | |
uses: shimataro/[email protected] | |
with: | |
key: ${{ secrets.KEYSAFE_DEPLOY_KEY }} | |
name: id_rsa | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
if_key_exists: replace | |
- name: Generate daily snapshot and publish it | |
env: | |
KEYSAFE_REPO_URL: ${{ secrets.KEYSAFE_REPO_URL }} | |
APP_KEYSAFE_NAME: ${{ secrets.APP_KEYSAFE_NAME }} | |
APP_KEYSAFE_PASSWORD: ${{ secrets.APP_KEYSAFE_PASSWORD }} | |
GITHUB_REPO: ${{ github.repository }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
bundle exec fastlane generate_daily_snapshot app_keysafe_name:"$APP_KEYSAFE_NAME" app_keysafe_password:"$APP_KEYSAFE_PASSWORD" artifact_type:AAB github_repository_name:"$GITHUB_REPO" github_api_token:"$GITHUB_TOKEN" |