Migrate CI from travis ci to github actions (#1355)

Ref #1352
This commit is contained in:
namusyaka
2020-11-16 11:47:55 +08:00
committed by GitHub
parent 8fcbc60969
commit 6baca72c4d
5 changed files with 59 additions and 67 deletions
+10 -7
View File
@@ -3,6 +3,9 @@
DATE=`date --iso-8601=date`
TIME=`date --iso-8601=seconds`
# GITHUB_PULL_REQUEST MUST be set by your own hands.
# See: https://github.com/actions/checkout/issues/58
cat > "./.bintray.json" <<EOF
{
"package": {
@@ -22,12 +25,12 @@ cat > "./.bintray.json" <<EOF
"name": "latest",
"desc": "Kompose build from master branch",
"released": "${DATE}",
"vcs_tag": "${TRAVIS_COMMIT}",
"attributes": [{"name": "TRAVIS_JOB_NUMBER", "values" : ["${TRAVIS_JOB_NUMBER}"], "type": "string"},
{"name": "TRAVIS_JOB_ID", "values" : ["${TRAVIS_JOB_ID}"], "type": "string"},
{"name": "TRAVIS_COMMIT", "values" : ["${TRAVIS_COMMIT}"], "type": "string"},
{"name": "TRAVIS_BRANCH", "values" : ["${TRAVIS_BRANCH}"], "type": "string"},
{"name": "TRAVIS_PULL_REQUEST", "values" : ["${TRAVIS_PULL_REQUEST}"], "type": "string"},
"vcs_tag": "${GITHUB_SHA}",
"attributes": [{"name": "GITHUB_RUN_NUMBER", "values" : ["${GITHUB_RUN_NUMBER}"], "type": "string"},
{"name": "GITHUB_RUN_ID", "values" : ["${GITHUB_RUN_ID}"], "type": "string"},
{"name": "GITHUB_SHA", "values" : ["${GITHUB_SHA}"], "type": "string"},
{"name": "GITHUB_REF", "values" : ["${GITHUB_REF}"], "type": "string"},
{"name": "GITHUB_PULL_REQUEST", "values" : ["${GITHUB_PULL_REQUEST}"], "type": "string"},
{"name": "date", "values" : ["${TIME}"], "type": "date"}],
"gpgSign": false
},
@@ -41,4 +44,4 @@ cat > "./.bintray.json" <<EOF
],
"publish": true
}
EOF
EOF
+1 -7
View File
@@ -1,11 +1,5 @@
#!/usr/bin/env bash
# Ensures that we run on Travis
if [ "$TRAVIS_BRANCH" != "master" ] || [ "$BUILD_DOCS" != "yes" ] || [ "$TRAVIS_SECURE_ENV_VARS" == "false" ] || [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
echo "Must be: a merged pr on the master branch, BUILD_DOCS=yes, TRAVIS_SECURE_ENV_VARS=false"
exit 0
fi
DOCS_REPO_NAME="kompose"
DOCS_REPO_URL="git@github.com:kubernetes/kompose.git"
DOCS_KEY="script/deploy_key"
@@ -82,7 +76,7 @@ git config user.email "$DOCS_EMAIL"
git add --all
# Check if anything changed, and if it's the case, push to origin/master.
if git commit -m 'Update docs' -m "Commit: https://github.com/kubernetes/kompose/commit/$TRAVIS_COMMIT" ; then
if git commit -m 'Update docs' -m "Commit: https://github.com/kubernetes/kompose/commit/$GITHUB_SHA" ; then
git push
fi
+1 -1
View File
@@ -23,7 +23,7 @@ openshift_exit_status=0
convert::start_test "Functional tests on OpenShift"
if [[ -n "${TRAVIS}" ]]; then
if [[ -n "${CI}" ]]; then
install_oc_client
fi