Skip to content

update catalog docker file #7

update catalog docker file

update catalog docker file #7

Workflow file for this run

name: Continuous Integration Wizard API
on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "*"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Demo image tag
if: startsWith(github.ref, 'refs/tags/')
shell: bash {0}
run: |
tag=$(git describe --tags HEAD)
echo "tag=$tag" >> $GITHUB_ENV
echo "environment=demo" >> $GITHUB_ENV
- name: Dev image tag
if: startsWith(github.ref, 'refs/heads/')
shell: bash {0}
run: |
tag="$(git rev-parse --short HEAD)"
echo "tag=$tag" >> $GITHUB_ENV
echo "environment=dev" >> $GITHUB_ENV
- name: Repo + image name environment variable
run: echo "repository=${GITHUB_REPOSITORY,,}/sd-creation-wizard-api" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: sd-creation-wizard-api/Dockerfile
push: true
tags: ghcr.io/${{ env.repository }}:${{ env.tag }},ghcr.io/${{ env.repository }}:latest
#- name: Dispatch update
# run: |
# curl -H "Accept: application/vnd.github+json" \
# -H "Authorization: token ${{ secrets.GIT_OPS_TOKEN }}" \
# --request POST \
# --data '{"event_type": "image_update", "client_payload": { "environment": "${{ env.environment }}", "tag": "${{ env.tag }}", "key": ".image.tag", "app": "creation-wizard-api" }}' https://api.github.com/repos/merlot-education/gitops/dispatches