Trigger GitLab Deploy Pipeline #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trigger GitLab Deploy Pipeline | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Check codebase"] | |
branches: | |
- develop | |
- master | |
- 'refs/tags/[0-9]+.[0-9]+.[0-9]+*' | |
types: | |
- completed | |
jobs: | |
trigger-gitlab: | |
name: Trigger GitLab CI | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Debug ref | |
run: echo ${{ github.ref_name }} | |
- name: Config Gitlab git env | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git remote add gitlab https://oauth2:${{ secrets.KILTBOT_PUSH_ACCESS_TOKEN }}@gitlab.com/kiltprotocol/kilt-node | |
- name: Push branch | |
run: git push gitlab ${{ github.ref_name }} | |
continue-on-error: true | |
- name: Push tag | |
run: git push gitlab tag ${{ github.ref_name }} | |
continue-on-error: true | |
- name: Push branch and follow tags | |
run: git push gitlab ${{ github.ref_name }} --follow-tags | |
- name: Trigger GitLab CI | |
run: | | |
curl -X POST \ | |
-F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} \ | |
-F ref=${{ github.ref_name }} \ | |
https://gitlab.com/api/v4/projects/${{ vars.GITLAB_PROJECT_ID }}/trigger/pipeline |