зеркало из https://github.com/Azure/reddog-code.git
Github Actions / Flux updates (#38)
* Created github action for accounting service.
This commit is contained in:
Родитель
065f1d97fc
Коммит
fe660b4af8
|
@ -0,0 +1,65 @@
|
|||
name: package-accounting-services
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'RedDog.AccountingService/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
set-env:
|
||||
name: Set Environment Variables
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.main.outputs.version }}
|
||||
created: ${{ steps.main.outputs.created }}
|
||||
services: ${{ steps.main.outputs.services }}
|
||||
repositories: ${{ steps.main.outputs.repositories }}
|
||||
steps:
|
||||
- id: main
|
||||
run: |
|
||||
echo ::set-output name=version::$(echo ${GITHUB_SHA} | cut -c1-7)
|
||||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
echo ::set-output name=services::[\"AccountingService accounting-service\"]
|
||||
echo ::set-output name=repositories::[\"ghcr.io/lynn-orrell/reddog\", \"ghcr.io/cloudnativegbb/paas-vnext\"]
|
||||
|
||||
package-services:
|
||||
name: Package Services
|
||||
runs-on: ubuntu-latest
|
||||
needs: set-env
|
||||
strategy:
|
||||
matrix:
|
||||
service: ${{ fromJSON(needs.set-env.outputs.services) }}
|
||||
repository: ${{ fromJSON(needs.set-env.outputs.repositories) }}
|
||||
steps:
|
||||
- uses: jungwinter/split@v1
|
||||
id: service-split
|
||||
with:
|
||||
msg: ${{ matrix.service }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.CR_PAT }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: RedDog.${{ steps.service-split.outputs._0 }}/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ matrix.repository }}/reddog-${{ steps.service-split.outputs._1 }}:latest
|
||||
${{ matrix.repository }}/reddog-${{ steps.service-split.outputs._1 }}:${{ needs.set-env.outputs.version }}
|
||||
labels: |
|
||||
org.opencontainers.image.source=${{ github.event.repository.html_url }}
|
||||
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
|
|
@ -5,6 +5,8 @@ metadata:
|
|||
namespace: reddog-branch
|
||||
labels:
|
||||
app: accounting-service
|
||||
annotations:
|
||||
fluxcd.io/automated: "true"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
|
|
Загрузка…
Ссылка в новой задаче