-
Notifications
You must be signed in to change notification settings - Fork 55
Create azure-webapps-node.yml #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
krsjenswbp
wants to merge
6
commits into
vercel:main
Choose a base branch
from
krsjenswbp:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b43aad8
[composite-actions] Create `install`
scubbo 84f3b28
Update README.md
krsjenswbp 000fabc
Create README.md
krsjenswbp e0c0d12
Create azure-webapps-node.yml
krsjenswbp bd071e4
Merge pull request #1 from vercel/add-install-composite-action
krsjenswbp 1b2e10a
Update SECURITY.md
krsjenswbp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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 }} |
This file contains hidden or 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,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 }} |
This file contains hidden or 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 +1,2 @@ | ||
| Shared community files for [the Vercel organization](https://vercel.com/). | ||
| https://smee.io/GfMQJ9vR23BJq1 | ||
|
|
This file contains hidden or 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
This file contains hidden or 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,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: ... | ||
| --> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok