Skip to content

Commit

Permalink
refactor workflow gitlab image building downstream #1
Browse files Browse the repository at this point in the history
  • Loading branch information
rhtot committed Oct 6, 2023
1 parent 96582d3 commit c0f2efd
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/nmc-trigger-gitlab-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,26 @@ jobs:
- name: Get Latest Artifact ID
id: get-artifact-id
run: |
# Use the GitHub API to get the latest artifact ID
ARTIFACT_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/nextmcloud/.github/actions/workflows/store-version-artifacts/runs/latest/artifacts" | \
jq -r '.artifacts[0].id')
ARTIFACT_ID=$(curl -s "https://api.github.com/repos/nextmcloud/server/actions/workflows" | jq -r '.workflows[0].id')
echo "::set-output name=artifact_id::$ARTIFACT_ID"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download versions artifact
run: |
# Download the artifact from the second workflow
curl -O -L -J -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/nextmcloud/.github/actions/artifacts/${{ steps.get-artifact-id.outputs.artifact_id }}/zip"
# Extract the archive
unzip versions-combined.zip
# Replace username/repo and ARTIFACT_ID with your repository and artifact details

- name: Trigger Nmc deployment image building with versions
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_IMAGE_TRIGGER_TOKEN }}
run: |
# Read the versions from the file
VERSIONS=$(cat versions-combined.txt)
# Trigger the GitLab pipeline with versions
curl -X POST \
--fail \
-F token=$GITLAB_TOKEN \
Expand Down

0 comments on commit c0f2efd

Please sign in to comment.