Update deploy_snapshot script for GitHub Actions (#1619)
diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
index c84ad2c..f63a107 100644
--- a/.github/workflows/validate.yml
+++ b/.github/workflows/validate.yml
@@ -30,9 +30,9 @@
name: Lint Results
path: lottie/build/reports
deploy:
+ if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [lint, unit-test]
- #if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout the code
uses: actions/checkout@v2
diff --git a/deploy_snapshot.sh b/deploy_snapshot.sh
index ecdaf8f..af61a1f 100755
--- a/deploy_snapshot.sh
+++ b/deploy_snapshot.sh
@@ -6,18 +6,13 @@
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
SLUG="airbnb/lottie-android"
-JDK="oraclejdk8"
-BRANCH="master"
+BRANCH="refs/head/master"
set -e
-if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
+if [ "$GITHUB_REPOSITORY" != "$SLUG" ]; then
echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
-elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
- echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'."
-elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
- echo "Skipping snapshot deployment: was pull request."
-elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
+elif [ "$GITHUB_REF" != "$BRANCH" ]; then
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
else
echo "Deploying snapshot..."