Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/composite-actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 'Install'
description: 'Sets up Node.js and runs install'

inputs:
npm-token:
description: 'A read-only npm token'
required: true
vercel-private-registry-token:
description: 'A token used to access the Vercel Private Registry'
required: true
node-version-file:
description: 'A custom node version'
required: false
default: '.nvmrc'
node-version:
description: 'The version of node, should be 16 or 20'
default: '20'
required: false
filter:
description: 'A list of pnpm filters - see https://pnpm.io/filtering'
required: false
default: ''


runs:
using: composite
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ${{ inputs.node-version-file }}
registry-url: 'https://registry.npmjs.org'

- name: "Install corepack v0.20"
if: ${{ inputs.node-version == '16' }}
shell: bash
run: |
echo "corepack version before: $(corepack --version)"
# 0.20 is the highest we can go, 0.20 drops node 16 support
# https://github.com/nodejs/corepack/blob/main/CHANGELOG.md#0210-2023-10-08
npm install -g corepack@0.20
echo "corepack version after: $(corepack --version)"

- name: "Install corepack@0.31"
if: ${{ inputs.node-version != '16' }}
shell: bash
run: |
npm install -g corepack@0.31
echo "corepack version after: $(corepack --version)"

- name: corepack enable (pnpm)
shell: bash
run: corepack enable
- name: Print pnpm version
shell: bash
run: |
echo "pnpm version after corepack enable: $(pnpm --version)"

- name: Parse filter
id: parse-filter
shell: bash
run: |
echo "pnpm-filter-args=$(echo '"${{ inputs.filter }}"' | jq -r 'split(" ") | map(select(. != "")) | map("--filter " + .) | join(" ")')" >> "$GITHUB_OUTPUT"

- name: Install dependencies
shell: bash
run: |
pnpm config set //vercel-private-registry.vercel.sh/:_authToken ${{ inputs.vercel-private-registry-token }}
# filter is a JSON string, so we need to parse it and pass it as separate arguments
pnpm ${{ steps.parse-filter.outputs.pnpm-filter-args }} install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
VERCEL_PRIVATE_REGISTRY_TOKEN: ${{ inputs.vercel-private-registry-token }}
78 changes: 78 additions & 0 deletions .github/workflows/azure-webapps-node.yml
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow will build and push a node.js application to an Azure Web App when a commit is pushed to your default branch.
#
# This workflow assumes you have already created the target Azure App Service web app.
# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-cli
#
# To configure this workflow:
#
# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal.
# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials
#
# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret.
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
#
# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables below.
#
# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions
# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples

on:
push:
branches: [ "main" ]
workflow_dispatch:

env:
AZURE_WEBAPP_NAME: your-app-name # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '20.x' # set this to the node version to use

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: .

deploy:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
environment:
name: 'Development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: node-app

- name: 'Deploy to Azure WebApp'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Shared community files for [the Vercel organization](https://vercel.com/).
https://smee.io/GfMQJ9vR23BJq1

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ If you believe you have found a security vulnerability, we encourage you to let

We will investigate all legitimate reports and do our best to quickly fix the problem.

Please report any vulnerabilities in our open source repositories to responsible.disclosure@vercel.com.
Please report any vulnerabilities in our open source email to minhtuktran@gmail.com.
16 changes: 16 additions & 0 deletions profile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Hi there 👋

<!--
**krsjenswbp/.github** is a ✨ _special_ ✨ repository because its `profile/README.md` (this file) appears on your GitHub profile.

Here are some ideas to get you started:

- 🔭 I’m currently working on ...
- 🌱 I’m currently learning ...
- 👯 I’m looking to collaborate on ...
- 🤔 I’m looking for help with ...
- 💬 Ask me about ...
- 📫 How to reach me: ...
- 😄 Pronouns: ...
- ⚡ Fun fact: ...
-->