-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deployment script and add environment variables
- Loading branch information
1 parent
9d16fda
commit d282025
Showing
2 changed files
with
28 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,13 @@ | ||
name: Node.js CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
schedule: | ||
- cron: '0 0 * * *' # Scheduled to run every day at midnight | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x, 16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run tests | ||
run: npm test | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Deploy to Cloud | ||
run: | | ||
echo "Deploying to the cloud..." | ||
# Here you would typically have a script or command that deploys your application | ||
# For example: | ||
# npm run deploy | ||
- name: Deploy to Cloud | ||
run: | | ||
echo "Deploying to the cloud..." | ||
# Here you would typically have a script or command that deploys your application | ||
# For example: | ||
# npm run deploy | ||
# Use the GitHub token to perform actions on GitHub | ||
echo "Using GitHub token to perform actions on GitHub..." | ||
# For example, to list the repositories for the authenticated user: | ||
# curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user/repos | ||
env: | ||
CLOUD_PROVIDER_API_KEY: ${{ secrets.CLOUD_PROVIDER_API_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Check Links | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
linkChecker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Check links in README.md | ||
uses: lycheeverse/[email protected] | ||
with: | ||
args: ./README.md |