Skip to content

Commit

Permalink
attempt to fix docker action
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Mar 29, 2021
1 parent ca0e208 commit e0f53c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Build
- name: Configure environment variables
run: |
VERSION=`cat DESCRIPTION | grep Version | sed 's#.*: ##'`
BRANCH="${GITHUB_REF#refs/heads/}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Build
run: |
docker build -t $GITHUB_REPOSITORY:$BRANCH -f docker/Dockerfile .
if [[ $BRANCH == "master" ]] ; then
docker tag $GITHUB_REPOSITORY:$BRANCH $GITHUB_REPOSITORY:$VERSION
Expand All @@ -30,7 +35,6 @@ jobs:
- name: Push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
BRANCH="${GITHUB_REF#refs/heads/}"
docker push $GITHUB_REPOSITORY:$BRANCH
if [[ $BRANCH == "master" ]] ; then
docker push $GITHUB_REPOSITORY:$VERSION
Expand Down

0 comments on commit e0f53c9

Please sign in to comment.