Skip to content
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

Switch to GitHub Actions #308

Merged
merged 15 commits into from
May 21, 2024
Merged

Switch to GitHub Actions #308

merged 15 commits into from
May 21, 2024

Conversation

MattiSG
Copy link
Member

@MattiSG MattiSG commented May 20, 2024

Details in #307.

Fixes #307, #284.

Integrates #286.


If merged:


Proofs that this works, that have to be double-checked:

  • CI can fail when errors are voluntarily introduced on lint and build.
  • Content updates in the openfisca.org repository, on the test-cd branch that was created as a test target branch as a duplicate of gh-pages. All files are changed because of the Sphinx (static website generator) update, but only those under the doc folder, as they should.
  • The dependency graph for CI and CD is valid.
image

@MattiSG MattiSG requested a review from Ndpnt May 20, 2024 21:19
MattiSG added a commit to openfisca/openfisca-core that referenced this pull request May 21, 2024
@MattiSG
Copy link
Member Author

MattiSG commented May 21, 2024

I tried to update the OpenFisca-Core doc update trigger, but encounter issues with GitHub access tokens.

I followed the Actions documentation on workflow: dispatch, created a fine-grained access token for the Bot, updated the Core workflow, but the trigger fails with the following message:

Resource not accessible by personal access token

Here is the token I created:

image

@MattiSG MattiSG linked an issue May 21, 2024 that may be closed by this pull request
@MattiSG
Copy link
Member Author

MattiSG commented May 21, 2024

Turns out organisation-level personal access tokens were not enabled on the OpenFisca org, I switched them on and could now create a proper PAT:

Capture d’écran 2024-05-21 à 14 36 50

Using this new token, the error is now:

curl -L \
    -X POST \
    -H "Accept: application/vnd.github+json" \
    -H "Authorization: Bearer github_pat_XXXXXXXXXXX" \
    -H "X-GitHub-Api-Version: 2022-11-28" \
    https://api.github.com/repos/openfisca/openfisca-doc/actions/workflows/deploy/dispatches \
    -d '{"ref":"cd"}'

→

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event"
}

@MattiSG
Copy link
Member Author

MattiSG commented May 21, 2024

I got the trigger to run from a Core commit!!

The workflow_id parameter turned out not to be deploy, but the filename of the workflow, i.e. deploy.yaml.

MattiSG added a commit to openfisca/openfisca-core that referenced this pull request May 21, 2024
@MattiSG MattiSG requested a review from Ndpnt May 21, 2024 13:13
@MattiSG
Copy link
Member Author

MattiSG commented May 21, 2024

Thanks a lot for your reviews @Ndpnt! Shipping this now 🤘

@MattiSG MattiSG merged commit 1dbb5ab into master May 21, 2024
3 of 4 checks passed
@MattiSG MattiSG deleted the cd-gh-actions branch May 21, 2024 15:57
MattiSG added a commit to openfisca/openfisca-core that referenced this pull request May 21, 2024
@MattiSG
Copy link
Member Author

MattiSG commented May 22, 2024

Deploy trigger updated in openfisca/openfisca-core#1211, all done! ✅

MattiSG added a commit to openfisca/openfisca.org that referenced this pull request May 22, 2024
The documentation now publishes directly to the `gh-pages` branch
See <openfisca/openfisca-doc#308>
MattiSG added a commit to openfisca/openfisca.org that referenced this pull request May 22, 2024
The documentation now publishes directly to the `gh-pages` branch
See <openfisca/openfisca-doc#308>
MattiSG added a commit to openfisca/openfisca-ops that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Continuous deployment is broken Switch from CircleCI to Github Actions
3 participants