on: push: # branches: # - develop env: # REGISTRY_IMAGE: ${{ vars.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }} REGISTRY_IMAGE: ${{ vars.REGISTRY }}/${{ github.repository }}:develop jobs: build: runs-on: docker container: image: forge.hornwitser.no/public/builder:r2025.5.2 steps: - name: Authenticate with registry run: | echo "${{ secrets.REGISTRY_TOKEN }}" | podman login ${{ vars.REGISTRY }} --username runner --password-stdin - name: Get commit info id: info shell: bash run: | tee -a ${GITHUB_OUTPUT} < ~/.git-credentials git clone --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }} - name: Build and push shell: bash run: | podman build --tag ${{ env.REGISTRY_IMAGE }} ${{ github.workspace }} podman push ${{ env.REGISTRY_IMAGE }} outputs: DEPLOY_IMAGE: ${{ steps.info.outputs.DEPLOY_IMAGE }} DEPLOY_BRANCH: ${{ steps.info.outputs.DEPLOY_BRANCH }} deploy: needs: build runs-on: docker container: image: forge.hornwitser.no/public/builder:r2025.5.2 steps: - name: Check info run: | echo DEPLOY_IMAGE=${{ needs.build.outputs.DEPLOY_IMAGE }} echo DEPLOY_BRANCH=${{ needs.build.outputs.DEPLOY_BRANCH }} # - # name: Checkout deploy repository # run: | # git config --global user.email runner@noreply.hornwitser.no # git config --global user.name Runner # git config --global credential.helper store # echo "https://runner:${{ secrets.DEPLOY_TOKEN }}@$(echo "${{ github.server_url }}" | cut -b 9-)" > ~/.git-credentials # git clone ${{ github.server_url }}/hornwitser/infra.git ${{ github.workspace }} - name: Restart deployment #if: github.ref_name == 'develop' run: | curl --silent \ --header "X-Secret: ${{ secrets.SERVICE_WEBHOOK_SECRET }}" \ --data action=restart \ --data service=schedule-demo \ "http://fulla.hz.hornwitser.no:9000/hooks/service"