Skip to content

Commit

Permalink
ci: adapt to namespace and branch name change
Browse files Browse the repository at this point in the history
  • Loading branch information
rvolosatovs committed Oct 19, 2021
1 parent eee17a2 commit f8985c0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- '**'
branches:
- master
- main
pull_request:
paths:
- .github/workflows/dockerimage.yml
Expand All @@ -20,15 +20,15 @@ jobs:
- name: Build the Docker image
run: ./build.sh -t build
- name: Push the Docker image
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
function tag_and_push {
docker tag build "rvolosatovs/protoc:${1}" && docker push "rvolosatovs/protoc:${1}"
}
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
tag_and_push "development"
elif [[ "${GITHUB_REF}" =~ refs/tags/v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
TAG="${GITHUB_REF#"refs/tags/v"}"
Expand All @@ -37,10 +37,6 @@ jobs:
tag_and_push "${TAG%.*}"
tag_and_push "${TAG%.*.*}";
tag_and_push "latest"
elif [[ "${TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-ttn$ ]]; then
tag_and_push "${TAG%.*}-ttn"
tag_and_push "${TAG%.*.*}-ttn";
tag_and_push "latest-ttn"
fi
else
tag_and_push "${GITHUB_REF#"refs/tags/"}"
Expand Down

0 comments on commit f8985c0

Please sign in to comment.