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

Setup CI-CD using Github Actions #9

Merged
merged 9 commits into from
Jun 14, 2020
Merged

Setup CI-CD using Github Actions #9

merged 9 commits into from
Jun 14, 2020

Conversation

asturur
Copy link
Member

@asturur asturur commented Jun 13, 2020

Done with CI-CD setup using GitHub Actions to build and deploy to gh-pages branch of fabricjs.github.io repo on push or pull-request on master branch

Closes #4
Closes #6

@asturur
Copy link
Member Author

asturur commented Jun 13, 2020

@nimworks it works!
is online here http://https://fabricjs.github.io/

Please review the PR, and then merge it.

In oreder to make it work i had to:

  • update to latest gatsby and babel
  • redo the package.lock
  • use GITHUB_TOKEN rather than GH_TOKEN
  • move everything to development branch and publish to master.

@asturur asturur requested a review from nimworks June 13, 2020 21:39
with:
node-version: 14
- name: Install dependencies
run: npm ci
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, we aren't using npm install
npm ci uses package-lock.json instead of the package.json and is deemed to give faster reliable builds.

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we name this to 'Build', coz I think this is what will appear on the default badge that Github Actions provide

Copy link
Member

@nimworks nimworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👏
Just some minor non-breaking tweaks and we can merge!

Comment on lines +25 to +29
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: master # default: gh-pages
Copy link
Member

@nimworks nimworks Jun 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't notice u had already tried this in one of your earlier commits!

Since GITHUB_TOKEN is made available by default by a app installed on the repo when we enable Github Actions, maybe just doing run: npm run deploy should work as well.

But, if it is already working this way, why to mingle with it, right 😁

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no the token does not work. We can remove the gh-pages npm package since when running is not recognized as an action. If you try to git push with gh-pages using the action token, it does not work. git asks you to auth.

@asturur asturur merged commit 3b6c456 into development Jun 14, 2020
@asturur asturur deleted the ci-cd-setup branch June 14, 2020 09:54
asturur pushed a commit that referenced this pull request Mar 6, 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
3 participants