|
1 |
| -name: Build Images |
| 1 | +name: Trigger GitLab CI |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - github-runner |
| 4 | + workflow_run: |
| 5 | + workflows: ["Srtool build", "Deploy Chain docs"] |
| 6 | + types: |
| 7 | + - completed |
7 | 8 |
|
8 | 9 | jobs:
|
9 |
| - build-images: |
| 10 | + trigger_gitlab: |
| 11 | + if: ${{ github.event.workflow_run.conclusion == 'success' }} |
10 | 12 | runs-on: ubuntu-latest
|
11 |
| - timeout-minutes: 120 |
12 |
| - env: |
13 |
| - DOCKER_HUB_PARACHAIN: kiltprotocol/kilt-node |
14 |
| - DOCKER_HUB_STANDALONE: kiltprotocol/standalone-node |
15 |
| - DOCKER_HUB_DIP_PROVIDER_TEMPLATE: kiltprotocol/dip-provider-node-template |
16 |
| - DOCKER_HUB_DIP_CONSUMER_TEMPLATE: kiltprotocol/dip-consumer-node-template |
17 |
| - AWS_REGISTRY: ${{ secrets.ECR_REGISTRY }} |
18 |
| - CI_COMMIT_SHORT_SHA: ${{ github.sha }} |
19 |
| - CI_COMMIT_BRANCH: ${{ github.ref_name }} |
20 |
| - CI_COMMIT_TAG: ${{ github.ref_name }} |
21 | 13 | steps:
|
22 |
| - - name: Free Disk Space |
23 |
| - uses: jlumbroso/free-disk-space@main |
24 |
| - with: |
25 |
| - tool-cache: true |
26 |
| - |
27 |
| - - name: Checkout |
28 |
| - uses: actions/checkout@v4 |
29 |
| - |
30 |
| - - name: Display AWS and Docker Versions |
31 |
| - run: | |
32 |
| - aws --version |
33 |
| - docker --version |
34 |
| -
|
35 |
| - - name: Log in to Docker Hub |
36 |
| - uses: docker/login-action@v3 |
37 |
| - with: |
38 |
| - username: ${{ secrets.DOCKER_USER }} |
39 |
| - password: ${{ secrets.DOCKERHUB_TOKEN }} |
40 |
| - |
41 |
| - - name: Login to ECR |
42 |
| - uses: docker/login-action@v3 |
43 |
| - with: |
44 |
| - registry: ${{ secrets.ECR_REGISTRY }} |
45 |
| - username: ${{ secrets.AWS_ACCESS_KEY_ID }} |
46 |
| - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
47 |
| - |
48 |
| - - name: Build Docker Images |
49 |
| - run: | |
50 |
| - ./.maintain/build-image.sh build |
51 |
| -
|
52 |
| - - name: Push Image - Tag |
53 |
| - if: startsWith(github.ref, 'refs/tags/') |
54 |
| - run: | |
55 |
| - ./.maintain/push-image.sh build "${{ env.CI_COMMIT_TAG }}" |
56 |
| -
|
57 |
| - - name: Push Image - Latest |
58 |
| - if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-rc') && !contains(github.ref, 'dev-') |
| 14 | + - name: Trigger GitLab CI |
| 15 | + env: |
| 16 | + GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }} |
| 17 | + GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }} |
59 | 18 | run: |
|
60 |
| - ./.maintain/push-image.sh build "latest" |
| 19 | + curl -X POST \ |
| 20 | + -F token=$GITLAB_TRIGGER_TOKEN \ |
| 21 | + -F ref=${{ github.ref_name }} \ |
| 22 | + https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/trigger/pipeline |
0 commit comments