ci: Ensure ci-imgs
repo is only triggered when new releases occur (…
#58
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: release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
RELEASE_PUBLISHED: ${{ steps.semantic-release.outputs.RELEASE_PUBLISHED }} | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- uses: ./.github/actions/setup-python | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "lts/*" | |
- name: Release | |
id: semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }} | |
run: | | |
npm install | |
npx semantic-release | |
trigger-pipeline: | |
if: needs.release.outputs.RELEASE_PUBLISHED == 'true' | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Trigger Pipeline | |
env: | |
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
run: | | |
gh workflow run push.yaml \ | |
--field upstream_job="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ | |
--field upstream_repository=dependency-file-generator \ | |
--repo rapidsai/ci-imgs \ | |
--ref main |