Skip to content

adding additional app names for images #52

adding additional app names for images

adding additional app names for images #52

Workflow file for this run

name: Build and Deploy Image
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_IMAGE_REPO: ghcr.io/rajpalc7/dts-endorser-service/
OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/
APP_NAME: aries-endorser-agent
env:

Check failure on line 18 in .github/workflows/main.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yaml

Invalid workflow file

You have an error in your yaml syntax on line 18
GITHUB_IMAGE_REPO: ghcr.io/rajpalc7/dts-endorser-service/
OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/
APP_NAME: aries-endorser-db
env:
GITHUB_IMAGE_REPO: ghcr.io/rajpalc7/dts-endorser-service/
OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/
APP_NAME: aries-endorser-backup
env:
GITHUB_IMAGE_REPO: ghcr.io/rajpalc7/dts-endorser-service/
OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/
APP_NAME: aries-endorser-proxy
env:
GITHUB_IMAGE_REPO: ghcr.io/rajpalc7/dts-endorser-service/
OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/
APP_NAME: aries-endorser-api
jobs:
build:
if: (github.repository == 'rajpalc7/dts-endorser-service') || (github.event_name == 'workflow_dispatch')
name: Build Image
permissions:
packages: write
runs-on: ubuntu-latest
outputs:
image_digest: ${{steps.docker_build.outputs.digest}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/rajpalc7/dts-endorser-service/aries-endorser-agent
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,value=latest
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/rajpalc7/dts-endorser-service/aries-endorser-db
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,value=latest
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/rajpalc7/dts-endorser-service/aries-endorser-backup
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,value=latest
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/rajpalc7/dts-endorser-service/aries-endorser-proxy
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,value=latest
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/rajpalc7/dts-endorser-service/aries-endorser-api
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,value=latest
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Display image results
run: |
echo 'imageid=${{ steps.docker_build.outputs.imageid }}'
echo 'digest=${{ steps.docker_build.outputs.digest }}'
deploy2dev:
needs: build
env:
ENVIRONMENT: dev
permissions:
packages: write
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy to ${{ env.ENVIRONMENT }}
uses: ./.github/workflows/actions/deploy
with:
environment: ${{ env.ENVIRONMENT }}
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }}
image_digest: ${{ needs.build.outputs.image_digest }}
openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }}
openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }}
namespace: ${{ vars.NAMESPACE }}
deployment_configuration: ${{ env.APP_NAME }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }}
# deploy2test:
# needs: [build, deploy2dev]
# env:
# ENVIRONMENT: test
# permissions:
# packages: write
# runs-on: ubuntu-latest
# environment: test
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: deploy to ${{ env.ENVIRONMENT }}
# uses: ./.github/workflows/actions/deploy
# with:
# environment: ${{ env.ENVIRONMENT }}
# ghcr_token: ${{ secrets.GITHUB_TOKEN }}
# github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }}
# image_digest: ${{ needs.build.outputs.image_digest }}
# openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }}
# openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }}
# namespace: ${{ vars.NAMESPACE }}
# deployment_configuration: ${{ env.APP_NAME }}
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }}
# deploy2prod:
# needs: [build, deploy2dev, deploy2test]
# env:
# ENVIRONMENT: prod
# permissions:
# packages: write
# runs-on: ubuntu-latest
# environment: prod
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: deploy to prod
# uses: ./.github/workflows/actions/deploy
# with:
# environment: ${{ env.ENVIRONMENT }}
# ghcr_token: ${{ secrets.GITHUB_TOKEN }}
# github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }}
# image_digest: ${{ needs.build.outputs.image_digest }}
# openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }}
# openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }}
# namespace: ${{ vars.NAMESPACE }}
# deployment_configuration: ${{ env.APP_NAME }}
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }}