Stream 11/3/2019 - Github Actions and Reversing Gravity
Tags: blog, todayilearned, devjournal
Published: 2019-11-03 21:36:00

### Check Out the Stream @ [https://twitch.tv/talk2megooseman](https://twitch.tv/talk2megooseman)

Had a great and fun stream today! Started it off fixing my Github Action and then learning about the new caching feature in Github Actions so dont have to re-install packages. After knocking that stuff I next started the adventure of doing reverse gravity command. 

# Today Objective

- [x]  Want go stuff from the past week
- [x]  What to call today's log
- [x]  Review last streams TODOs
- [x]  Fix an issue Github Action failing to `yarn install` because of a permissions error
- [x]  Make sure we deploy latest code for twitch-interactive-overlay
- [x]  Work on more items on the Projects Board [https://github.com/talk2MeGooseman/twitch-interactive-overlay/projects/1](https://github.com/talk2MeGooseman/twitch-interactive-overlay/projects/1)
    - [ ]  Working on a reverse gravity command

# Notes

- Sharing some cool stuff
    - [https://starship.rs/](https://starship.rs/) - Cool cli addon
    - [https://github.com/standard-things/esm](https://github.com/standard-things/esm) - Run JS with out babel!
    - Had a great stream over on the CodingZeal channel learning about lerna [Stream 11/1/2019 - Lerna and Mono-Repos](https://www.notion.so/b64d2001-22c0-4713-8efc-db65f589317b)
    - Great article I read about structuring redux in a nice way [https://jaysoo.ca/2016/02/28/organizing-redux-application/](https://jaysoo.ca/2016/02/28/organizing-redux-application/)
    - Dont know redux that much? Great intro article [https://www.robinwieruch.de/redux-javascript?utm_campaign=React%2BNewsletter&utm_medium=web&utm_source=React_Newsletter_181](https://www.robinwieruch.de/redux-javascript?utm_campaign=React%2BNewsletter&utm_medium=web&utm_source=React_Newsletter_181)
- Github Actions `yarn install` issue
    - Here is the error I am seeing [https://github.com/talk2MeGooseman/twitch-interactive-overlay/commit/6df712ab7becea20f77b855853670fbd3e3bb00c/checks?check_suite_id=292549368](https://github.com/talk2MeGooseman/twitch-interactive-overlay/commit/6df712ab7becea20f77b855853670fbd3e3bb00c/checks?check_suite_id=292549368)
    - Removing `Borales/actions-yarn@master` since Yarn is already installed in the env now
        - Example of caching the yarn install
```
            steps:
                - uses: actions/checkout@master
                - name: Cache node modules
                  uses: actions/cache@preview
                  with:
                    path: node_modules
                    key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
                    restore-keys: |
                      ${{ runner.os }}-node-
                
                - name: yarn install
                  if: steps.cache.outputs.cache-hit != 'true'
                  run: |
                    yarn install
```
- Reverse gravity command in Phaser.io
    - We can set the gravity via `scene.physics.world.gravity.y = -400`
    - Need to update the math for our sprite animations and position because its assuming a positive gravity so all the commands will look just wrong
    - Tweak the logic in the UserSprite to changes the Y velocities if the gravity is flipped. But the same logic has to be spread to the other sprites the spawn on the screen. So decided to finally make a base class to have some base logic instead of just defaulting to user helper module.
    - Will need to finish doing the refactoring and switch the various sprite classes to use the new BaseSprite class

# Shoutouts and Thanks

- Lannonbr
    - For sharing with us the new `cache` feature for Github Actions: [https://github.com/actions/cache/](https://github.com/actions/cache/)
- indifferentghost
    - 6 month Resub
- iScreemCodes
    - 3 months Twitch Prime Resub
- cmgriffing
    - Raid of 18
- theMichaelJolley
    - Raid of 44
- 

# Future action items

- [ ]  Finish the BaseSprite refactoring