Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,32 @@ jobs:
run: |
docker build . --file TransactionProcessor/Dockerfile --tag stuartferguson/transactionprocessor:latest --tag stuartferguson/transactionprocessor:${{ steps.get_version.outputs.VERSION }}

- name: Publish Images to Docker Hub
- name: Publish Images to Docker Hub - Pre Release
if: ${{ github.event.release.prerelease == true }}
run: |
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/transactionprocessor:dev

- name: Publish Images to Docker Hub - Formal Release
if: ${{ github.event.release.prerelease == false }}
run: |
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/transactionprocessor:latest
docker push stuartferguson/transactionprocessor:${{ steps.get_version.outputs.VERSION }}

- name: Publish API
if: ${{ github.event.release.prerelease == false }}
run: dotnet publish "TransactionProcessor\TransactionProcessor.csproj" --configuration Release --output publishOutput

- name: Install Octopus CLI
if: ${{ github.event.release.prerelease == false }}
run: |
sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
sudo apt update && sudo apt install octopuscli

- name: Pack Files for Octopus
if: ${{ github.event.release.prerelease == false }}
run: >-
octo pack
--outFolder /home/runner/work/TransactionProcessor/TransactionProcessor
Expand All @@ -64,6 +73,7 @@ jobs:
--logLevel=verbose

- name: Push Package to Octopus
if: ${{ github.event.release.prerelease == false }}
run: >-
octo push
--server ${{ secrets.OCTOPUS_URL }}
Expand All @@ -72,6 +82,7 @@ jobs:
--overwrite-mode IgnoreIfExists

- name: Get Release
if: ${{ github.event.release.prerelease == false }}
id: getrelease
uses: octokit/request-action@v2.0.17
with:
Expand All @@ -80,13 +91,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Release Notes
if: ${{ github.event.release.prerelease == false }}
id: buildreleasenotes
uses: gr2m/get-json-paths-action@v1.0.4
with:
json: ${{ steps.getrelease.outputs.data }}
releasenote: "body"

- name: Create & Deploy Release in Octopus
if: ${{ github.event.release.prerelease == false }}
run: >-
octo create-release
--server ${{ secrets.OCTOPUS_URL }}
Expand All @@ -100,6 +113,7 @@ jobs:
--releasenotes "${{ steps.buildreleasenotes.outputs.releasenote }}"

- name: Build and Publish Nuget Packages
if: ${{ github.event.release.prerelease == false }}
run: |
dotnet pack "TransactionProcessor.Client\TransactionProcessor.Client.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets
dotnet nuget push Nugets/TransactionProcessor.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Pre-Release Nuget
name: Publish Pre-Release Nugets and Docker

on:
push:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
build:
name: "Publish Pre-Release Nugets"
name: "Publish Pre-Release Nugets and Docker"
env:
ASPNETCORE_ENVIRONMENT: "Production"

Expand Down Expand Up @@ -53,4 +53,10 @@ jobs:
dotnet pack "TransactionProcessor.Settlement.DomainEvents\TransactionProcessor.Settlement.DomainEvents.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets
dotnet nuget push Nugets/TransactionProcessor.Settlement.DomainEvents.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package

- name: Publish Images to Docker Hub
run: |
docker build . --file TransactionProcessor/Dockerfile --tag stuartferguson/transactionprocessor:master
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/transactionprocessor:master