CI/CD GitHub Action enhancements (test build / enhanced naming / updated actions) - #93
CI/CD GitHub Action enhancements (test build / enhanced naming / updated actions)#93swissbuechi wants to merge 2 commits into
Conversation
Enahnced naming Updated actions (keep FTP Deploy on v3)
JackMorrissey
left a comment
There was a problem hiding this comment.
Hey thanks, I'll take a look at this when I have some more time. I just want to triple check that I'm not going to expose secrets in PR builds/forks. The FTP deploy has been broken for a while, so I'll likely take your suggestion and switch packages.
|
@JackMorrissey Sounds great. I'll create a PR with the new action if you wish. |
|
Na no worries. I'll make some time to do it to deploy your update changes. It'll be easier to test with secrets and whatnot from my side. Thanks though! |
|
This is next on my list. Just ran out of time. Thanks again for the huge contributions. |
I'll resolve the conflict tomorrow 👍🏼 Have you thought about hosting on GitHub pages? Seems like this stateless project would be a perfect fit tho. Just add a custom domain and call it a day. |
GitHub Action enhancements
The following changes were made to the
main.ymlGitHub Action:Test builds
Run build on every commit, but deploy only when in master.
I removed
branches: [ master ]to automatically run the action on every commit in every branch.This way, you can always verify if the
buildof the project works.You should also configure the action to need to pass on every PR as follows:
Require status checks to pass before mergingbuild-and-deployas aStatus checks that are requiredAdditionally, on the
deploystep, I addedif: github.ref == 'refs/heads/master'to only trigger the FTP upload if we are in themasterbranch.Updated actions
Actions like
setup-nodeandcheckoutcan usually be updated to the latest version without any problems.I could also update the
FTP-Deploy-Actionfrom3.1.1to3.1.2. Not sure about the4.x.xversions, I've read they somehow do not support SFTP anymore and only use SCP now. Needs to be checked with the FTP Server. If we want to keep on using SFTP I would suggest a maintained action like https://github.com/wlixcc/SFTP-Deploy-Action/, worked fine for me in other projects.Other small improvements
README.mdare ignored and do not trigger a run of the action, achieved by configuring them inpaths-ignore:.permissions: contents: readto limit the scope of theGH_TOKEN.workflow_dispatch:to manually trigger the action if a redeploy to the FTP server is required for example.Disclaimer
Sadly, I could not test all of these changes.
I'm happy to support you if anything goes wrong when merged.