From dfac8cfdc4246efa8ff7a9627a9f19b128515def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Garc=C3=ADa=20Rodr=C3=ADguez?= Date: Thu, 24 Dec 2020 10:44:05 +0100 Subject: [PATCH] build on pr --- .github/workflows/basket-api.yml | 33 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/basket-api.yml b/.github/workflows/basket-api.yml index 53e17927e..7caeaadaf 100644 --- a/.github/workflows/basket-api.yml +++ b/.github/workflows/basket-api.yml @@ -16,21 +16,37 @@ on: - master - dev env: - REGISTRY_ENDPOINT: borjasanes + REGISTRY_ENDPOINT: eshop REGISTRY_HOST: docker.io SERVICES: basket-api jobs: + + GetImageTag: + runs-on: ubuntu-latest + steps: + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + BuildContainersForPR_Linux: - runs-on: ubuntu-16.04 - if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-latest + #if: ${{ github.event_name == 'pull_request' }} steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + - name: Compose build ${{ env.SERVICES }} - run: docker-compose build -f src/docker-compose.yml ${{ env.SERVICES }} + run: sudo -E docker-compose build ${{ env.SERVICES }} + working-directory: ./src shell: bash env: - TAG: ${{ env.branch }} + TAG: ${{ env.BRANCH }} REGISTRY: ${{ env.REGISTRY_ENDPOINT }} + BuildContainersForPR_Windows: runs-on: windows-2019 if: ${{ false }} @@ -58,13 +74,6 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} - - name: Set branch name as env variable - run: | - currentbranch=$(echo ${GITHUB_REF##*/}) - echo "running on $currentbranch" - echo "BRANCH=$currentbranch" >> $GITHUB_ENV - shell: bash - - name: Compose build ${{ env.SERVICES }} run: sudo -E docker-compose build ${{ env.SERVICES }} working-directory: ./src