diff options
author | Yevhen Bondarenko <evgeniy.bondarenko@sentrium.io> | 2024-10-10 17:29:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-10 17:29:25 +0200 |
commit | f9978c81c59045464166825e6a5b17f5867cd6ad (patch) | |
tree | dd28d0c4dcf42c8ab987c31cda8cc41edfae7c87 | |
parent | cde77d07d1615f0aefe576170f0ace5b1dd2b5da (diff) | |
download | vyos-build-f9978c81c59045464166825e6a5b17f5867cd6ad.tar.gz vyos-build-f9978c81c59045464166825e6a5b17f5867cd6ad.zip |
T6771: Build docker image without Jenkinsevgsentrium/T6771
-rw-r--r-- | .github/workflows/trigger-docker-image-build.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/trigger-docker-image-build.yml b/.github/workflows/trigger-docker-image-build.yml new file mode 100644 index 00000000..783622c9 --- /dev/null +++ b/.github/workflows/trigger-docker-image-build.yml @@ -0,0 +1,47 @@ +name: Trigger Docker image build
+
+on:
+ pull_request_target:
+ types:
+ - closed
+ branches:
+ - current
+
+permissions:
+ packages: write
+ contents: read
+ attestations: write
+ id-token: write
+ pull-requests: read
+
+jobs:
+ track-changes:
+ if: github.event.pull_request.merged == true
+ runs-on: ubuntu-latest
+
+ env:
+ REF: main # Used for curl to trigger image build
+
+ steps:
+ - name: Checkout vyos/vyos-build repo
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.ref_name }}
+
+ - uses: dorny/paths-filter@v3
+ id: changes
+ with:
+ filters: |
+ docker-dir:
+ - 'docker/**'
+
+ - name: "Trigger Docker image build for ${{ github.ref_name }}"
+ if: ${{ steps.changes.outputs.docker-dir }}
+ run: |
+ curl -L \
+ -X POST \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer ${{ secrets.PAT }}" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ https://api.github.com/repos/${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REUSE_REPO }}/actions/workflows/build-docker-image.yml/dispatches \
+ -d '{"ref": "${{ env.REF }}", "inputs":{"branch":"${{ github.ref_name }}", "environment":"production"}}'
\ No newline at end of file |