зеркало из https://github.com/Azure/reddog-code.git
Updated actions
This commit is contained in:
Родитель
4cde971133
Коммит
93005ff816
|
@ -3,7 +3,7 @@ name: package-make-line-service
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'contoso-health'
|
||||
- 'master'
|
||||
paths:
|
||||
- 'RedDog.MakeLineService/**'
|
||||
|
||||
|
@ -16,12 +16,67 @@ jobs:
|
|||
outputs:
|
||||
version: ${{ steps.main.outputs.version }}
|
||||
created: ${{ steps.main.outputs.created }}
|
||||
services: ${{ steps.main.outputs.services }}
|
||||
repositories: ${{ steps.main.outputs.repositories }}
|
||||
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=services::[\"MakeLineService make-line-service\"]
|
||||
echo ::set-output name=repositories::[\"ghcr.io/lynn-orrell/reddog\", \"ghcr.io/cloudnativegbb/paas-vnext\"]
|
||||
echo ::set-output name=project::MakeLineService
|
||||
echo ::set-output name=image::reddog-retail-make-line-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: .
|
||||
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 }}
|
||||
- name: Update deployment yaml
|
||||
uses: fjogeleit/yaml-update-action@master
|
||||
with:
|
||||
valueFile: 'manifests/branch/base/deployments/make-line-service.yaml'
|
||||
propertyPath: 'spec.template.spec.containers.0.image'
|
||||
value: ${{ needs.set-env.outputs.repository }}/${{ needs.set-env.outputs.image }}:${{ needs.set-env.outputs.version }}
|
||||
commitChange: 'false'
|
||||
branch: 'master'
|
||||
message: 'Updated make-line service deployment manifest.'
|
||||
createPR: 'false'
|
||||
updateFile: 'true'
|
||||
- name: Echo yaml
|
||||
run: |
|
||||
cat manifests/branch/base/deployments/make-line-service.yaml
|
||||
- name: Promote deployment
|
||||
uses: dmnemec/copy_file_to_another_repo_action@main
|
||||
env:
|
||||
API_TOKEN_GITHUB: ${{ secrets.CR_PAT }}
|
||||
with:
|
||||
source_file: manifests/branch/base/deployments/make-line-service.yaml
|
||||
destination_repo: Azure/reddog-retail-demo
|
||||
destination_folder: manifests/branch/base/deployments
|
||||
user_email: lynn.orrell@microsoft.com
|
||||
user_name: lynn-orrell
|
Загрузка…
Ссылка в новой задаче