stages: - build - test - staging - prod build-site: stage: build image: node:14.5.0 variables: NODE_OPTIONS: "--max_old_space_size=2048" script: - cd ./src - make build-site artifacts: paths: - ./src/dist/dynamicbible build-android: stage: build image: gradle:6.7.1-jdk8 before_script: - curl -sL https://deb.nodesource.com/setup_14.x | bash - - apt-get install -y nodejs - cd ./src/android - bash ./install-sdk.sh - cd .. script: - pwd - npm ci - npm run-script build - npm run-script copy - cd android - gradle signingReport - gradle assembleRelease - gradle bundleRelease artifacts: paths: - ./src/android/app/build/outputs test: stage: test image: walljm/node-chrome-headless:14.8.0 variables: NODE_OPTIONS: "--max_old_space_size=2048" script: - cd ./src - make test needs: ["build-site"] deploy-staging: stage: staging image: google/cloud-sdk script: - cd ./src - make deploy-staging rules: - if: '$CI_COMMIT_BRANCH == "main"' when: on_success allow_failure: false needs: ["build-site"] deploy-prod-site: stage: prod image: google/cloud-sdk script: - cd ./src - make deploy-prod rules: - if: '$CI_COMMIT_BRANCH == "main"' when: manual allow_failure: false needs: ["build-site"] deploy-android: stage: prod image: gradle:6.7.1-jdk8 before_script: - curl -sL https://deb.nodesource.com/setup_14.x | bash - - apt-get install -y nodejs - cd ./src/android - bash ./install-sdk.sh - cd .. script: - pwd - npm ci - npm run-script build - npm run-script copy - cd android - gradle publishRelease artifacts: paths: - ./src/android/app/build/outputs rules: - if: '$CI_COMMIT_BRANCH == "main"' when: manual allow_failure: false needs: ["build-android"]