From 475e07b93c1ebc9c5cf5a01654bd767fd589b1e8 Mon Sep 17 00:00:00 2001 From: David Sanz Date: Wed, 23 Dec 2020 11:22:12 +0100 Subject: [PATCH] Get git branch name --- .github/workflows/basket-api.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/basket-api.yml b/.github/workflows/basket-api.yml index 41d181ff1..1e5a77f3d 100644 --- a/.github/workflows/basket-api.yml +++ b/.github/workflows/basket-api.yml @@ -14,18 +14,9 @@ env: registryEndpoint: services: basket-api image: basket.api - branch: $(echo ${GITHUB_REF#refs/heads/}) + # branch: $(echo ${GITHUB_REF#refs/heads/}) jobs: - # login: - # runs-on: ubuntu-latest - # steps: - # - name: Login to Container Registry - # uses: docker/login-action@v1 - # with: - # registry: ${{ env.registryEndpoint }} - # username: ${{ secrets.USERNAME }} - # password: ${{ secrets.PASSWORD }} BuildContainersForPR_Linux: runs-on: ubuntu-16.04 if: ${{ github.event_name == 'pull_request' }} @@ -63,8 +54,18 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} + - name: Get branch name + run: | + currentbranch=$(echo ${GITHUB_REF#refs/heads/}) + echo $currentbranch + echo "branch=$currentbranch" >> $GITHUB_ENV + shell: bash + - name: Compose build ${{ env.services }} - run: sudo docker-compose -f src/docker-compose.yml build ${{ env.services }} + run: | + echo "A initial message" + sudo docker-compose -f src/docker-compose.yml build ${{ env.services }} + docker images shell: bash env: TAG: ${{ env.branch }}