This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
Replies: 3 comments 2 replies
-
Discussion with @AbrarNitk
|
Beta Was this translation helpful? Give feedback.
0 replies
-
We can also integrate Heroku APIs in FPM itself and let people only install Heroku Commands heroku login
heroku authorizations:create
git push heroku main
etc... FPM Commands fpm heroku login
fpm heroku authorizations:create
etc... https://devcenter.heroku.com/articles/platform-api-reference |
Beta Was this translation helpful? Give feedback.
1 reply
-
How to handle if Heroku expires the token, which we are using in GitHub actions? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Status: Done(From AbrarK)
Owner: @AbrarNitk @Arpita-Jaiswal
Started On: 7th Sept 2022
TODO
/clear-cache/?everything=true
15th Sept 2022
14th Sept 2022
fpm-heroku
repo to add button infpm-template
](fastn-stack/fastn-heroku@8c18d4113th Sept 2022
Deployment of FPM on Heroku is working.
7th Sept 2022
The Tutorial: Deploy FPM Package On Heroku
Note: There is another way to deploy on Heroku using build-packs as well.
What we are trying to achieve is: package content hosted on Github, and served via Heroku. Currently we serve via Github Page/Vercel (most of our packages) or via fpm-controller (abrark.com).
Deploy FPM on Heroku
With #457 implemented now we can deploy
fpm
on Heroku. Lets deploy it there.First manually deploy fpm on heroku. Once it works fine, we will implement the button. Use Docker. But preferably, since we have a binary itself, we can create a github repo, which contains a Profile and fpm binary.
Say the repo we are hosting is
abrark.com
, how to runfpm
using cli?Button
We need to create a deploy Heroku Button so anyone can deploy fpm on heroku in one click. The button should be on
fpm
's README.md.We need to specify a configuration, the fpm package URL, so maybe we can not put it in README of fpm and it has to be in the readme of the package itself. For each package we have a github repo, and their README, so the button should be there.
We will have to pass the package name as a parameter, maybe we can use
https://heroku.com/deploy?template=https://github.com/fifthtry/fpm-heroku&env[DOWNLOAD_BASE_URL]=https://raw.githubusercontent.com/AbrarNitk/abrark/main/
syntax.Procfile
will pass the env to cli:Github Hook To Invalidate
On every commit to Github package repo, in main branch, we want to invalidate the cache. So create an github action yml file that will run on every push, and will call
https://<package-url>/-/clear-cache/?package=main&all-dependencies=true
.Incremental Deletes
If in the commit only two files were modified, we need not delete all files and dependencies. I think it is possible to fetch the list of files modified in the commit (or maybe we can ask FPM itself for the last commit it knows about, so say FPM will keep track of latest commit, so we will fetch last commit fpm knows about, then do a diff to find what all files were modified in Github action, and then tell fpm which files to delete and the latest commit hash).
We have to get fpm to keep track of commit has as in case two commits happen one after another, there may be some issue, or if the action failed to start the file will never be updated etc. I feel the only way to reliably get file list is by doing what I described.
Resources
Beta Was this translation helpful? Give feedback.
All reactions