зеркало из https://github.com/Azure/reddog-code.git
Add pipeline for corp transfer service (#46)
* Build transfer service * Update CorporateTransferService.yml * Rename CorporateTransferService.yml to package-corp-transfer-service.yaml * Update package-corp-transfer-service.yaml * test * test * Update package-corp-transfer-service.yaml * Remove test * Change repository to /azure/reddog-retail-demo
This commit is contained in:
Родитель
e5994702b4
Коммит
4cb4942324
|
@ -0,0 +1,58 @@
|
||||||
|
name: package-corp-transfer-service
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
paths:
|
||||||
|
- 'RedDog.CorporateTransferService/**'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
set-env:
|
||||||
|
name: Set Environment Variables
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.main.outputs.version }}
|
||||||
|
created: ${{ steps.main.outputs.created }}
|
||||||
|
project: ${{ steps.main.outputs.project }}
|
||||||
|
image: ${{ steps.main.outputs.image }}
|
||||||
|
repository: ${{ steps.main.outputs.repository }}
|
||||||
|
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=project::CorporateTransferService
|
||||||
|
echo ::set-output name=image::reddog-retail-corp-transfer-service
|
||||||
|
echo ::set-output name=repository::ghcr.io/azure/reddog-retail-demo
|
||||||
|
|
||||||
|
package-service:
|
||||||
|
name: Package Service
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: set-env
|
||||||
|
steps:
|
||||||
|
- 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: RedDog.${{ needs.set-env.outputs.project }}
|
||||||
|
file: RedDog.${{ needs.set-env.outputs.project }}/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ needs.set-env.outputs.repository }}/${{ needs.set-env.outputs.image }}:latest
|
||||||
|
${{ needs.set-env.outputs.repository }}/${{ needs.set-env.outputs.image }}:${{ needs.set-env.outputs.version }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.source=${{ github.repositoryUrl }}
|
||||||
|
org.opencontainers.image.created=${{ needs.set-env.outputs.created }}
|
||||||
|
org.opencontainers.image.revision=${{ needs.set-env.outputs.version }}
|
Загрузка…
Ссылка в новой задаче