mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Implement a custom deployment condition via bash
This commit is contained in:
parent
90f747a2a9
commit
b05583a8b0
@ -15,18 +15,17 @@ before_deploy:
|
|||||||
- rm -Rf ./node_modules .docs ./preview ./tests *.log*
|
- rm -Rf ./node_modules .docs ./preview ./tests *.log*
|
||||||
- rm -Rf ./src/system/icons/_all
|
- rm -Rf ./src/system/icons/_all
|
||||||
- rm -Rf ./src/system/tokens/_examples
|
- rm -Rf ./src/system/tokens/_examples
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
- provider: npm
|
- provider: npm
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
email: $NPM_EMAIL
|
email: $NPM_EMAIL
|
||||||
api_key: $NPM_TOKEN
|
api_key: $NPM_TOKEN
|
||||||
on:
|
on:
|
||||||
tags: true
|
condition: ./deployment_condition.sh
|
||||||
condition: $(git branch --contains $TRAVIS_TAG | grep -l '^[\* ] master$')
|
|
||||||
- provider: pages
|
- provider: pages
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
|
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
|
||||||
keep_history: true
|
keep_history: true
|
||||||
on:
|
on:
|
||||||
tags: true
|
condition: ./deployment_condition.sh
|
||||||
condition: $(git branch --contains $TRAVIS_TAG | grep -l '^[\* ] master$')
|
|
||||||
|
|||||||
17
deployment_condition.sh
Executable file
17
deployment_condition.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
if [ "$BRANCH" != "master" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CURRENT_VERSION=$(cat package.json | jq -r .version)
|
||||||
|
PUBLISHED_VERSION=$(yarn info @human-connection/styleguide version --silent)
|
||||||
|
|
||||||
|
if [ "$CURRENT_VERSION" == "$PUBLISHED_VERSION" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
||||||
Loading…
x
Reference in New Issue
Block a user