ci: deploy should be a manual action #577
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: forge/ayaports#577
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With the migration from Gitlab, it's become impossible to setup a manual trigger for the deploy workflow. Thus, instead, the deploy workflow always sends the built package to the repo, if the build completes. If the upstream file already exists, it deletes it and reuploads. I need to keep track of upstream changes, because (at least on Github), it should be possible to setup a /deploy comment trigger, but due to API limitations it is not currently possible. Notably:
issue_comment
triggers, but since they run from the default repo they don't have access to those tokensSee https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 for an example of an implementation.
I've figured out another approach. Forgejo has a WIP function which can be picked up in-workflow using
curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/${{ github.event.number }} | jq .draft
. Logics can be put put into deploy.sh to deploy to a different repo when draft=true for testing. Ideally, it would upload as an artifact, similar to the workflow that I had with the Lab. Unfortunately, upload-artifact always zips the artifacts up, defeating that use-case. We could upload to our own repo, but perhaps in a test branch (i.e. v3.20/user-staging rather than v3.20/user).It would be a good way to test things, and maybe some code could be figured out to clear *-staging whenever we're done.
This is (somewhat) implemented through the WIP functionality. When deployment is done while WIP is in the title, the built artifacts get sent to *-testing rather than the targetted branch. To deploy to production branches, you just need to remove the WIP from title, and restart deploy step in CI.