├── .firebase └── hosting.cHVibGlj.cache ├── .firebaserc ├── .github ├── .gitkeep └── workflows │ ├── deploy.yml │ └── integrate.yml ├── .gitignore ├── README.md ├── firebase.json ├── package-lock.json ├── package.json ├── public ├── 404.html ├── bundle.js ├── index.html └── pug.jpg └── src ├── app.js └── app.test.js /.firebase/hosting.cHVibGlj.cache: -------------------------------------------------------------------------------- 1 | 404.html,1583961189792,daa499dd96d8229e73235345702ba32f0793f0c8e5c0d30e40e37a5872be57aa 2 | index.html,1583951620350,379f160962e97c378c70dbb5a6186edfd5b2067796fd37a7fd3d708b75748524 3 | bundle.js,1583955119048,f9d51d893803fb4b04f0d61cc54a5a05710dd91bf7396a88bd9c54bfd2cfa78b 4 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "fireship-lessons" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.github/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireship-io/225-github-actions-demo/e0823288192dcd65b41d0546630b4da3509e6b65/.github/.gitkeep -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Firebase Continuous Deployment 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@master 13 | - uses: actions/setup-node@master 14 | with: 15 | node-version: 12 16 | - run: npm ci 17 | - run: npm run build 18 | - uses: w9jds/firebase-action@master 19 | with: 20 | args: deploy --only hosting 21 | env: 22 | FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/integrate.yml: -------------------------------------------------------------------------------- 1 | name: Node Continuous Integration 2 | 3 | on: 4 | pull_request: 5 | branches: [ master ] 6 | 7 | 8 | jobs: 9 | test_pull_request: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: actions/setup-node@v1 14 | with: 15 | node-version: 12 16 | - run: npm ci 17 | - run: npm test 18 | - run: npm run build -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github Actions Demo 2 | 3 | Implement CI/CD with Github Actions. 4 | 5 | Watch the [100 Seconds of CI/CD](https://youtu.be/scEDHsr3APg) and the [Full Github Actions Tutorial](https://youtu.be/eB0nUzAI7M8) on YouTube. 6 | 7 | Firebase User? Checkout the guide for [Deploying Firebase Apps with GithHub Actions](https://fireship.io/snippets/github-actions-deploy-angular-to-firebase-hosting/). 8 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "public", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ], 9 | "rewrites": [ 10 | { 11 | "source": "**", 12 | "destination": "/index.html" 13 | } 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "devops", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "jest", 8 | "build": "webpack src/app.js -o public/bundle.js", 9 | "deploy": "firebase deploy --token \"$FIREBASE_TOKEN\" --only hosting" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "devDependencies": { 15 | "jest": "^25.1.0", 16 | "webpack": "^4.42.0", 17 | "webpack-cli": "^3.3.11" 18 | }, 19 | "dependencies": { 20 | "firebase-tools": "^7.14.0", 21 | "terser": "^4.6.6" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Page Not Found 7 | 8 | 23 | 24 | 25 |
26 |

404

27 |

Page Not Found

28 |

The specified file was not found on this website. Please check the URL for mistakes and try again.

29 |

Why am I seeing this?

30 |

This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html file in your project's configured public directory.

31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /public/bundle.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=(e=new Date)=>["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()];try{document.getElementById("day").innerText=n()}catch(e){}t.dayOfTheWeek=n}]); -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Document 7 | 8 | 9 | 10 |

What day is it? 😕

11 |

Today is ?

12 | 13 | pug 14 | 15 | -------------------------------------------------------------------------------- /public/pug.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireship-io/225-github-actions-demo/e0823288192dcd65b41d0546630b4da3509e6b65/public/pug.jpg -------------------------------------------------------------------------------- /src/app.js: -------------------------------------------------------------------------------- 1 | const dayOfTheWeek = (date = new Date()) => { 2 | const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; 3 | 4 | return days[date.getDay()]; 5 | } 6 | 7 | 8 | try { 9 | document.getElementById('day').innerText = dayOfTheWeek(); 10 | } catch(err) {} 11 | 12 | 13 | exports.dayOfTheWeek = dayOfTheWeek; -------------------------------------------------------------------------------- /src/app.test.js: -------------------------------------------------------------------------------- 1 | const { dayOfTheWeek } = require('./app'); 2 | 3 | 4 | test('getDay returns the long-format day of the week', () => { 5 | const day = dayOfTheWeek( new Date('3/11/2020') ); 6 | expect( day ).toBe('Wednesday'); 7 | }); --------------------------------------------------------------------------------