Skip to content

Commit

Permalink
Setup GitHub actions to deploy to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
RonanCodes committed Apr 29, 2024
1 parent ad1c56a commit 302106a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Deploy
on:
push:
branches:
- main # change this to your default branch name if it's not 'main'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build:prod

- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist/chuck-norris-joke-generator # The folder the action should deploy.
token: ${{ secrets.GH_TOKEN }} # The GitHub token.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build:prod": "ng build --configuration=production --base-href=/chuck-norris-joke-generator/",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
Expand Down

0 comments on commit 302106a

Please sign in to comment.