Browse Source

build on pr

pull/1565/head
Borja García Rodríguez 4 years ago
parent
commit
dfac8cfdc4
1 changed files with 21 additions and 12 deletions
  1. +21
    -12
      .github/workflows/basket-api.yml

+ 21
- 12
.github/workflows/basket-api.yml View File

@ -16,21 +16,37 @@ on:
- master - master
- dev - dev
env: env:
REGISTRY_ENDPOINT: borjasanes
REGISTRY_ENDPOINT: eshop
REGISTRY_HOST: docker.io REGISTRY_HOST: docker.io
SERVICES: basket-api SERVICES: basket-api
jobs: 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: BuildContainersForPR_Linux:
runs-on: ubuntu-16.04
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
#if: ${{ github.event_name == 'pull_request' }}
steps: steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICES }} - 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 shell: bash
env: env:
TAG: ${{ env.branch }}
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ env.REGISTRY_ENDPOINT }} REGISTRY: ${{ env.REGISTRY_ENDPOINT }}
BuildContainersForPR_Windows: BuildContainersForPR_Windows:
runs-on: windows-2019 runs-on: windows-2019
if: ${{ false }} if: ${{ false }}
@ -58,13 +74,6 @@ jobs:
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} 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 }} - name: Compose build ${{ env.SERVICES }}
run: sudo -E docker-compose build ${{ env.SERVICES }} run: sudo -E docker-compose build ${{ env.SERVICES }}
working-directory: ./src working-directory: ./src


Loading…
Cancel
Save