diff --git a/.github/workflows/basket-api.yml b/.github/workflows/basket-api.yml index a909f6d5d..d9fe47035 100644 --- a/.github/workflows/basket-api.yml +++ b/.github/workflows/basket-api.yml @@ -3,9 +3,8 @@ name: basket-api on: push: branches: - - master + - main - dev - - feature/github-actions paths: - src/BuildingBlocks/* @@ -14,7 +13,7 @@ on: pull_request: branches: - - master + - main - dev env: SERVICE: basket-api @@ -139,7 +138,4 @@ jobs: shell: pwsh env: TAG: ${{ env.BRANCH }} - REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} - - - \ No newline at end of file + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} \ No newline at end of file diff --git a/.github/workflows/catalog-api.yml b/.github/workflows/catalog-api.yml new file mode 100644 index 000000000..797311042 --- /dev/null +++ b/.github/workflows/catalog-api.yml @@ -0,0 +1,141 @@ +name: catalog-api + +on: + push: + branches: + - main + - dev + + paths: + - src/BuildingBlocks/* + - src/Services/Catalog/* + - .github/workflows/catalog-api.yml + + pull_request: + branches: + - main + - dev +env: + SERVICE: catalog-api + IMAGE: catalog.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildContainersForPR_Windows: + + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + 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.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash + + BuildWindows: + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Login to Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ env.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + shell: pwsh + run: echo "BRANCH=$($env:GITHUB_REF.replace('refs/heads/', ''))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: docker-compose push ${{ env.SERVICE }}' + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} \ No newline at end of file diff --git a/.github/workflows/catalog-api/workflow.yml b/.github/workflows/catalog-api/workflow.yml deleted file mode 100644 index 86e945388..000000000 --- a/.github/workflows/catalog-api/workflow.yml +++ /dev/null @@ -1,25 +0,0 @@ -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -on: - push: - branches: - - master - - dev - paths: - - src/BuildingBlocks/* - - src/Services/Catalog/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/catalog-api/* - - deploy/k8s/helm/catalog-api/* -env: - registryEndpoint: eshop-registry -jobs: - job_1_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 - job_2_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 \ No newline at end of file diff --git a/.github/workflows/identity-api.yml b/.github/workflows/identity-api.yml new file mode 100644 index 000000000..e22ee83c0 --- /dev/null +++ b/.github/workflows/identity-api.yml @@ -0,0 +1,141 @@ +name: identity-api + +on: + push: + branches: + - main + - dev + + paths: + - src/BuildingBlocks/* + - src/Services/Identity/* + - .github/workflows/identity-api.yml + + pull_request: + branches: + - main + - dev +env: + SERVICE: identity-api + IMAGE: identity.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildContainersForPR_Windows: + + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + 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.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash + + BuildWindows: + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Login to Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ env.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + shell: pwsh + run: echo "BRANCH=$($env:GITHUB_REF.replace('refs/heads/', ''))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: docker-compose push ${{ env.SERVICE }}' + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} \ No newline at end of file diff --git a/.github/workflows/identity-api/workflow.yml b/.github/workflows/identity-api/workflow.yml deleted file mode 100644 index 3c6f692e1..000000000 --- a/.github/workflows/identity-api/workflow.yml +++ /dev/null @@ -1,25 +0,0 @@ -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -on: - push: - branches: - - master - - dev - paths: - - src/BuildingBlocks/* - - src/Services/Identity/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/identity-api/* - - deploy/k8s/helm/identity-api/* -env: - registryEndpoint: eshop-registry -jobs: - job_1_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 - job_2_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 \ No newline at end of file diff --git a/.github/workflows/infrastructure/workflow.yml b/.github/workflows/infrastructure/workflow.yml deleted file mode 100644 index 50e5a5907..000000000 --- a/.github/workflows/infrastructure/workflow.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - push: - branches: - - master - - dev - paths: - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/infrastructure/* - - deploy/k8s/helm/basket-data/* - - deploy/k8s/helm/keystore-data/* - - deploy/k8s/helm/nosql-data/* - - deploy/k8s/helm/rabbitmq/* - - deploy/k8s/helm/sql-data/* -env: - registryEndpoint: eshop-registry -jobs: - build: - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@v2 - - run: Copy '${{ github.workspace }}/deploy/k8s/helm/' '${{ github.workspace }}/deploy/k8s/helm' - shell: powershell - - uses: actions/upload-artifact@v2 - with: - path: ${{ github.workspace }}/deploy/k8s/helm - name: helm \ No newline at end of file diff --git a/.github/workflows/mobile-shopping-agg/workflow.yml b/.github/workflows/mobile-shopping-agg/workflow.yml deleted file mode 100644 index 791da1360..000000000 --- a/.github/workflows/mobile-shopping-agg/workflow.yml +++ /dev/null @@ -1,24 +0,0 @@ -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -on: - push: - branches: - - master - - dev - paths: - - src/ApiGateways/Mobile.Bff.Shopping/aggregator/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/mobile-shopping-agg/* - - deploy/k8s/helm/mobileshoppingagg/* -env: - registryEndpoint: eshop-registry -jobs: - job_1_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 - job_2_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 \ No newline at end of file diff --git a/.github/workflows/ordering-api.yml b/.github/workflows/ordering-api.yml new file mode 100644 index 000000000..33ba506fa --- /dev/null +++ b/.github/workflows/ordering-api.yml @@ -0,0 +1,141 @@ +name: ordering-api + +on: + push: + branches: + - main + - dev + + paths: + - src/BuildingBlocks/* + - src/Services/Ordering/* + - .github/workflows/ordering-api.yml + + pull_request: + branches: + - main + - dev +env: + SERVICE: ordering-api + IMAGE: ordering.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildContainersForPR_Windows: + + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + 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.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash + + BuildWindows: + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Login to Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ env.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + shell: pwsh + run: echo "BRANCH=$($env:GITHUB_REF.replace('refs/heads/', ''))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: docker-compose push ${{ env.SERVICE }}' + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} \ No newline at end of file diff --git a/.github/workflows/ordering-api/workflow.yml b/.github/workflows/ordering-api/workflow.yml deleted file mode 100644 index d9bd9061a..000000000 --- a/.github/workflows/ordering-api/workflow.yml +++ /dev/null @@ -1,27 +0,0 @@ -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet -on: - push: - branches: - - master - - dev - paths: - - src/BuildingBlocks/* - - src/Services/Ordering/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/ordering-api/* - - deploy/k8s/helm/ordering-api/* - - deploy/k8s/helm/ordering-backgroundtasks/* - - deploy/k8s/helm/ordering-signalrhub/* -env: - registryEndpoint: eshop-registry -jobs: - job_1_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 - job_2_template: - # 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet' - steps: - - uses: actions/checkout@v2 \ No newline at end of file diff --git a/.github/workflows/webshoppingagg.yml b/.github/workflows/webshoppingagg.yml new file mode 100644 index 000000000..dc51c8242 --- /dev/null +++ b/.github/workflows/webshoppingagg.yml @@ -0,0 +1,140 @@ +name: webshoppingagg + +on: + push: + branches: + - main + - dev + + paths: + - src/ApiGateways/Web.Bff.Shopping/aggregator/* + - .github/workflows/webshoppingagg.yml + + pull_request: + branches: + - main + - dev +env: + SERVICE: webshoppingagg + IMAGE: webshoppingagg + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildContainersForPR_Windows: + + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + 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.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash + + BuildWindows: + runs-on: windows-2019 + if: ${{ false }} + # if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Login to Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ env.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + shell: pwsh + run: echo "BRANCH=$($env:GITHUB_REF.replace('refs/heads/', ''))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Compose build ${{ env.SERVICE }} + run: docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: docker-compose push ${{ env.SERVICE }}' + working-directory: ./src + shell: pwsh + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} \ No newline at end of file