2020-12-22 13:53:57 +01:00
|
|
|
name: basket-api
|
|
|
|
|
2020-12-22 13:45:30 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- dev
|
2020-12-22 13:55:24 +01:00
|
|
|
- feature/github-actions
|
2020-12-22 13:45:30 +01:00
|
|
|
paths:
|
|
|
|
- src/BuildingBlocks/*
|
|
|
|
- src/Services/Basket/*
|
2020-12-22 13:53:57 +01:00
|
|
|
- .github/workflows/basket-api.yml
|
2020-12-22 13:45:30 +01:00
|
|
|
env:
|
|
|
|
registryEndpoint: https://hub.docker.com/repository/docker/borjasanes/eshoponcontainers
|
|
|
|
services: basket-api
|
|
|
|
image: basket.api
|
|
|
|
branch: $(echo ${GITHUB_REF#refs/heads/})
|
|
|
|
jobs:
|
2020-12-22 15:20:28 +01:00
|
|
|
Login:
|
|
|
|
runs-on: ubuntu-16.04
|
2020-12-22 13:45:30 +01:00
|
|
|
steps:
|
2020-12-22 15:26:49 +01:00
|
|
|
- name: Login to docker registry
|
2020-12-22 15:31:31 +01:00
|
|
|
run: echo "username:${{ secrets.USERNAME }}"
|
|
|
|
shell: bash
|
2020-12-22 13:45:30 +01:00
|
|
|
BuildContainersForPR_Linux:
|
|
|
|
runs-on: ubuntu-16.04
|
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
steps:
|
|
|
|
- name: Compose build ${{ env.services }}
|
|
|
|
run: docker-compose build -f src/docker-compose.yml ${{ env.services }}
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
TAG: ${{ env.branch }}
|
|
|
|
REGISTRY: ${{ env.registryEndpoint }}
|
|
|
|
BuildContainersForPR_Windows:
|
|
|
|
runs-on: windows-2019
|
|
|
|
if: ${{ false }}
|
|
|
|
# if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
steps:
|
|
|
|
- name: Compose build ${{ env.services }}
|
|
|
|
run: docker-compose build -f src/docker-compose.yml ${{ env.services }}
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
TAG: ${{ env.branch }}
|
|
|
|
REGISTRY: ${{ env.registryEndpoint }}
|
|
|
|
PLATFORM: win
|
|
|
|
NODE_IMAGE: stefanscherer/node-windows:10
|
|
|
|
BuildLinux:
|
|
|
|
runs-on: ubuntu-16.04
|
|
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
|
|
steps:
|
2020-12-22 13:49:52 +01:00
|
|
|
- name: Compose build ${{ env.services }}
|
2020-12-22 13:45:30 +01:00
|
|
|
run: docker-compose build -f src/docker-compose.yml ${{ env.services }}
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
TAG: ${{ env.branch }}
|
|
|
|
REGISTRY: ${{ env.registryEndpoint }}
|
|
|
|
- name: Compose push ${{ env.image }}
|
|
|
|
run: docker-compose push -f src/docker-compose.yml ${{ env.services }}'
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
TAG: ${{ env.branch }}
|
|
|
|
REGISTRY: ${{ env.registryEndpoint }}
|
|
|
|
BuildWindows:
|
|
|
|
runs-on: windows-2019
|
|
|
|
if: ${{ false }}
|
|
|
|
# if: ${{ github.event_name != 'pull_request' }}
|
|
|
|
steps:
|
2020-12-22 13:49:52 +01:00
|
|
|
- name: Compose build ${{ env.services }}
|
2020-12-22 13:45:30 +01:00
|
|
|
run: docker-compose build -f src/docker-compose.yml ${{ env.services }}
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
TAG: ${{ env.branch }}
|
|
|
|
REGISTRY: ${{ env.registryEndpoint }}
|
|
|
|
- name: Compose push ${{ env.image }}
|
|
|
|
run: docker-compose push -f src/docker-compose.yml ${{ env.services }}'
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
TAG: ${{ env.branch }}
|
|
|
|
REGISTRY: ${{ env.registryEndpoint }}
|