use trigger to call other workflow

This commit is contained in:
Ulf Gebhardt 2023-03-06 10:53:23 +01:00
parent 540c3bd9c4
commit baedff2f94
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 27 additions and 20 deletions

View File

@ -1,9 +1,7 @@
name: ocelot.social publish branded CI
name: publish-branded
on:
push:
branches:
- master
repository_dispatch:
types: [trigger_build_success]
jobs:
build_branded:
name: Docker Build Branded
@ -11,7 +9,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.ref }}
- name: Build branded images
run: |
deployment/scripts/branded-images.build.sh
@ -45,9 +44,6 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v2
with:
@ -73,13 +69,4 @@ jobs:
run: docker load < /tmp/maintenance-branded.tar
- name: Upload to dockerhub
run: deployment/scripts/branded-images.upload.sh
# - name: login to dockerhub
# run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
#
# - name: Push Backend
# run: docker push --all-tags ocelotsocialnetwork/backend-branded
# - name: Push Webapp
# run: docker push --all-tags ocelotsocialnetwork/webapp-branded
# - name: Push Maintenance
# run: docker push --all-tags ocelotsocialnetwork/maintenance-branded
run: deployment/scripts/branded-images.upload.sh

View File

@ -1,4 +1,4 @@
name: ocelot.social publish CI
name: publish
on:
push:
@ -280,6 +280,26 @@ jobs:
draft: false
prerelease: false
build_trigger:
name: Trigger successful build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch full History for changelog
- name: Setup env
run: |
echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
- run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
event-type: trigger_build_success
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "VERSION": "${VERSION}", "BUILD_DATE": "${BUILD_DATE}", "BUILD_COMMIT": "${BUILD_COMMIT}", "BUILD_VERSION": "${BUILD_VERSION}"}'
# ##############################################################################
# # JOB: KUBERNETES DEPLOY ACTUAL/LATEST VERSION ######################################
# ##############################################################################