Skip to content

Instantly share code, notes, and snippets.

@watanabeyu
Last active February 26, 2019 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watanabeyu/69c42b79800baa8691ac0447866a2252 to your computer and use it in GitHub Desktop.
Save watanabeyu/69c42b79800baa8691ac0447866a2252 to your computer and use it in GitHub Desktop.
expoの.circleciでブランチごとにOTA
version: 2
references:
container_config: &container_config
docker:
- image: circleci/node:latest
install_expo_cli: &install_expo_cli
run:
name: install-expo-cli
command: sudo npm install -g expo-cli
login_expo_cli: &login_expo_cli
run:
name: login-expo
command: expo login -u $EXPO_ACCOUNT -p $EXPO_PASSWORD --non-interactive
jobs:
code_check:
<<: *container_config
steps:
- checkout
# npm setting
- restore_cache:
keys: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
# workspace
- persist_to_workspace:
root: .
paths:
- .
# build development
development_build:
<<: *container_config
steps:
- checkout
# workspace
- attach_workspace:
at: .
# expo
- *install_expo_cli
- *login_expo_cli
# publish
- run:
name: development build
command: expo publish --release-channel development --config app.development.json
# build production
production_build:
<<: *container_config
steps:
- checkout
# workspace
- attach_workspace:
at: .
# expo
- *install_expo_cli
- *login_expo_cli
# build
- run:
name: production build
command: expo publish --release-channel production --config app.production.json
workflows:
version: 2
build_and_test:
jobs:
- code_check
- development_build:
requires:
- code_check
filters:
branches:
only:
- develop
- production_build:
requires:
- code_check
filters:
branches:
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment