Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci files for playback service #133

Merged
merged 1 commit into from
Aug 15, 2023
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
64 changes: 61 additions & 3 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker Image CI

on:
push:
branches: [ "main" ]
branches: [ "main", "deploy-test" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "deploy-test" ]

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -50,4 +50,62 @@ jobs:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}

build-playbackservice:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup DotNet Environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Build and publish
run: |
dotnet publish -c Release tools/PlaybackService

- name: Test
run: |
dotnet test -c Release --no-build tools/PlaybackService

- name: Build Container Image
uses: docker/build-push-action@v4
with:
context: tools/PlaybackService/src/
tags: ghcr.io/azure/azure-media-migration-playback-service:${{ github.sha }}, ghcr.io/azure/azure-media-migration-playback-service:latest

- name: Log in to the Container registry
uses: docker/login-action@v2
if: ${{ github.event_name == 'push' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Container Image
if: ${{ github.event_name == 'push' }}
run: |
docker push ghcr.io/azure/azure-media-migration-playback-service:${{ github.sha }}
docker push ghcr.io/azure/azure-media-migration-playback-service:latest

- name: Login Kubernets
uses: azure/k8s-set-context@v1
if: ${{ github.event_name == 'push' }}
with:
kubeconfig: '${{ secrets.AMSTEST_EASTUS_KUBECONFIG }}'

- name: Deploy
uses: Azure/k8s-deploy@v4
if: ${{ github.event_name == 'push' }}
with:
namespace: amstest
manifests: |
tools/PlaybackService/deployment/playbackservice.yaml
images: |
ghcr.io/azure/azure-media-migration-playback-service:${{ github.sha }}
10 changes: 4 additions & 6 deletions tools/PlaybackService/deployment/playbackservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: playbackservice
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: playbackservice
Expand All @@ -12,11 +12,9 @@ spec:
labels:
app: playbackservice
spec:
imagePullSecrets:
- name: amtestcr-secret
containers:
- name: playbackservice
image: amstest.azurecr.io/ams-ok/playbackservice:latest
image: ghcr.io/azure/azure-media-migration-playback-service:latest
ports:
- containerPort: 80
env:
Expand Down Expand Up @@ -62,10 +60,10 @@ metadata:
spec:
tls:
- hosts:
- playback.ams-ok.net
- playback.amstest.org
secretName: playbackservice-https-cert
rules:
- host: playback.ams-ok.net
- host: playback.amstest.org
http:
paths:
- path: /
Expand Down
Loading