-
Notifications
You must be signed in to change notification settings - Fork 11
CI: redeploy ok-dspace on pushes to clarin-v7 #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
d336e85
9029e18
94eb17a
e11f62f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,11 +62,37 @@ jobs: | |
| REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }} | ||
| REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }} | ||
|
|
||
| # deploy: | ||
| # needs: dspace-angular | ||
| # uses: ufal/dspace-angular/.github/workflows/deploy.yml@clarin-v7 | ||
| # if: ${{ github.event_name != 'pull_request' }} | ||
| # with: | ||
| # INSTANCE: '5' | ||
| # IMPORT: false | ||
| # secrets: inherit | ||
| ########################################################################### | ||
| # Notify ufal/dspace-k8s of a new build, for the ok-dspace test environment | ||
| ########################################################################### | ||
| # Replaces the old commented-out deploy stub, which targeted the dataquest | ||
| # docker-compose instances (dev-5/dev-8) we no longer have access to. | ||
| # | ||
| # Runs only for pushes to `clarin-v7` - currently the default branch, named | ||
| # explicitly here because that is exactly what the guard below matches - and | ||
| # only after the image this environment consumes has actually been pushed. | ||
| # | ||
| # This job records a new version; it does not deploy. It sends a | ||
| # repository_dispatch to ufal/dspace-k8s, which pins the tag to git, and a | ||
| # reconciler inside that cluster applies it. No deployment step and no cluster | ||
| # credential exists in this repository, or anywhere in GitHub. | ||
| deploy-ok-dspace: | ||
| if: github.repository == 'ufal/dspace-angular' && github.event_name == 'push' && github.ref_name == 'clarin-v7' | ||
| # dspace-angular-dist, NOT dspace-angular: the latter builds the '-dev' | ||
| # suffixed image, while the overlay runs the unsuffixed dist image. | ||
| needs: [dspace-angular-dist] | ||
| runs-on: ubuntu-latest | ||
| # This job authenticates with a PAT and never uses GITHUB_TOKEN, so it needs | ||
| # none of the workflow-level permissions. Dropping them limits what a | ||
| # compromised third-party action could reach from here. | ||
| permissions: {} | ||
| steps: | ||
| - name: Notify ufal/dspace-k8s | ||
| uses: peter-evans/repository-dispatch@v4 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use and action, hand roll it with curl (or gh cli if possible)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done — - name: Notify ufal/dspace-k8s
env:
GH_TOKEN: ${{ secrets.OK_DSPACE_DEPLOY_TOKEN }}
SHA: ${{ github.sha }}
run: |
set -euo pipefail
jq -n --arg sha "${SHA}" \
'{event_type: "deploy-ok-dspace",
client_payload: {component: "frontend", sha: $sha}}' \
| gh api -X POST repos/ufal/dspace-k8s/dispatches --input -The payload is built by The real gain is that the PAT is no longer in the environment of third-party code for the sake of one POST. I also fixed the
|
||
| with: | ||
| # Fine-grained PAT, scoped to ufal/dspace-k8s only, Contents: write | ||
| # (what POST /repos/{owner}/{repo}/dispatches requires). | ||
| token: ${{ secrets.OK_DSPACE_DEPLOY_TOKEN }} | ||
| repository: ufal/dspace-k8s | ||
| event-type: deploy-ok-dspace | ||
| client-payload: '{"component":"frontend","sha":"${{ github.sha }}"}' | ||
Uh oh!
There was an error while loading. Please reload this page.