Skip to content

Refactor(ISSUE80) - Mass Transit #41

Refactor(ISSUE80) - Mass Transit

Refactor(ISSUE80) - Mass Transit #41

Workflow file for this run

name: Deploy Worker
on:
workflow_dispatch:
push:
branches: ["dev"]
tags: ["v*"]
paths:
- src/Adapters/Houston.Workers/**
- src/Core/**
- .github/workflows/deploy-worker.yml
pull_request:
branches: ["dev"]
paths:
- src/Adapters/Houston.Workers/**
- src/Core/**
- .github/workflows/deploy-worker.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Create testing private key
run: ssh-keygen -t rsa -b 4096 -m PEM -N "" -f /home/runner/work/houston/houston/src/Tests/Houston.API.UnitTests/bin/Debug/net6.0/PrivateKey.pem
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Docker Login
if: github.event_name != 'pull_request'
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set image tags
if: github.event_name != 'pull_request'
id: tag
run: |
if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = true ]; then
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
else
echo "::set-output name=tag::dev"
fi
- name: Build and push Docker images (DEV)
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/dev')
uses: docker/build-push-action@v2.7.0
with:
push: ${{ github.event_name != 'pull_request' }}
tags: jpcarpanezi/houston-workers:dev
file: src/Adapters/Houston.Workers/Dockerfile
context: ./
- name: Build and push Docker images (TAGS)
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v2.7.0
with:
push: ${{ github.event_name != 'pull_request' }}
tags: |
jpcarpanezi/houston-workers:${{ steps.tag.outputs.tag }}
jpcarpanezi/houston-workers:latest
file: src/Adapters/Houston.Workers/Dockerfile
context: ./