diff --git a/.github/workflows/publish-branded.yml b/.github/workflows/publish-branded.yml index 2877aa213..e9dc62751 100644 --- a/.github/workflows/publish-branded.yml +++ b/.github/workflows/publish-branded.yml @@ -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 \ No newline at end of file + run: deployment/scripts/branded-images.upload.sh \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3b7fdaf60..f9d3f0ecb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 ###################################### # ##############################################################################