Only build docker/electron packages on stable (#2930)

* Only build docker/electron packages on stable

* Docker script cleanup
This commit is contained in:
Jaco Greeff 2020-06-11 08:08:27 +02:00 committed by GitHub
parent e879668d7d
commit cd0f271fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 21 deletions

View File

@ -34,7 +34,7 @@ jobs:
# only run on "CI skip", i.e. when the actual version has been bumped to release/stable
docker:
name: docker
if: "startsWith(github.event.head_commit.message, '[CI Skip] release/') && github.repository == 'polkadot-js/apps'"
if: "startsWith(github.event.head_commit.message, '[CI Skip] release/stable') && github.repository == 'polkadot-js/apps'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@ -50,7 +50,7 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
if: "startsWith(github.event.head_commit.message, '[CI Skip] release/') && github.repository == 'polkadot-js/apps'"
if: "startsWith(github.event.head_commit.message, '[CI Skip] release/stable') && github.repository == 'polkadot-js/apps'"
name: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1

View File

@ -18,25 +18,16 @@ VERSION=$(cat package.json \
| sed 's/[",]//g' \
| sed 's/ //g')
# helper function for the build logic
function build () {
echo "*** Building $NAME"
docker build -t $NAME .
}
echo "*** Building $NAME"
docker build -t $NAME .
# helper function for the publishing logic
function publish () {
docker login -u $REPO -p $DOCKER_PASS
docker login -u $REPO -p $DOCKER_PASS
echo "*** Tagging $REPO/$NAME"
if [[ $VERSION != *"beta"* ]]; then
docker tag $NAME $REPO/$NAME:$VERSION
fi
docker tag $NAME $REPO/$NAME
echo "*** Tagging $REPO/$NAME"
if [[ $VERSION != *"beta"* ]]; then
docker tag $NAME $REPO/$NAME:$VERSION
fi
docker tag $NAME $REPO/$NAME
echo "*** Publishing $NAME"
docker push $REPO/$NAME
}
build
publish
echo "*** Publishing $NAME"
docker push $REPO/$NAME