Deploy Using GitHub Actions
- Go to your GitHub repository and navigate to the Actions tab.
- Click New Workflow or select Set up a workflow yourself.
- Create a new file named
deploy.yml
in the .github/workflows/
directory.
- Copy and paste the code below into
deploy.yml
using the copy button.
- Commit the file to your repository to trigger the workflow.
- Monitor the workflow progress in the Actions tab and ensure it completes successfully.
name: Node.js CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 */6 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Start application
run: npm start