Skip to content

Commit 987c68d

Browse files
authored
Merge pull request #111420 from aaronpowell/aapowell/assa-vuepress
VuePress quick start
2 parents a8e1484 + 91a9aa0 commit 987c68d

File tree

7 files changed

+163
-159
lines changed

7 files changed

+163
-159
lines changed
53 KB
Loading
28.6 KB
Loading
59.2 KB
Loading
62.2 KB
Loading
19.7 KB
Loading
Lines changed: 148 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,167 @@
11
---
2-
title: "Tutorial: Publish a VuePress site to App Service Static Apps"
3-
description: #Required; article description that is displayed in search results.
4-
services: #Required for articles that deal with a service; service slug assigned to your service by ACOM.
2+
title: "Tutorial: Publish a VuePress site to Azure Static Web Apps"
3+
description: This tutorial shows you how to deploy a VuePress application to Azure Static Web Apps.
4+
services: static-web-apps
55
author: aaronpowell
6-
ms.service: azure-functions
7-
ms.topic: tutorial
6+
ms.service: static-web-apps
7+
ms.topic: tutorial
88
ms.date: 05/08/2020
99
ms.author: aapowell
1010
---
1111

12-
<!--
13-
Refer to the following guide for more details:
14-
https://review.docs.microsoft.com/en-us/help/contribute/contribute-how-to-mvc-tutorial?branch=master
15-
-->
12+
# Tutorial: Publish a VuePress site to Azure Static Web Apps
1613

17-
<!---Recommended: Removal all the comments in this template before you sign-off or merge to master.--->
14+
This article demonstrates how to create and deploy a [VuePress](https://vuepress.vuejs.org/) web application to [Azure Azure Static Web Apps](overview.md). The final result is a new Azure Static Web Apps application with the associated GitHub Actions that give you control over how the app is built and published.
1815

19-
# Tutorial: Publish a VuePress site to App Service Static Apps
16+
In this tutorial, you learn how to:
2017

21-
<!---Required:
22-
Starts with "Tutorial: "
23-
Make the first word following "Tutorial:" a verb.
24-
--->
18+
> [!div class="checklist"]
19+
>
20+
> - Create a VuePress app
21+
> - Setup an Azure Static Web Apps
22+
> - Deploy the VuePress app to Azure
2523
26-
Introductory paragraph.
24+
## Prerequisites
2725

28-
<!---Required:
29-
Lead with a light intro that describes, in customer-friendly language,
30-
what the customer will learn, or do, or accomplish. Answer the
31-
fundamental "why would I want to do this?" question.
32-
--->
26+
- An Azure account with an active subscription. If you don't have one, you can [create an account for free](https://azure.microsoft.com/free/).
27+
- A GitHub account. If you don't have one, you can [create an account for free](https://github.com/join).
28+
- [Node.js](https://nodejs.org) installed.
3329

34-
In this tutorial, you learn how to:
30+
## Create a VuePress App
3531

36-
> [!div class="checklist"]
37-
> * All tutorials include a list summarizing the steps to completion
38-
> * Each of these bullet points align to a key H2
39-
> * Use these green checkboxes in a tutorial
40-
<!---Required:
41-
The outline of the tutorial should be included in the beginning and at
42-
the end of every tutorial. These will align to the **procedural** H2
43-
headings for the activity. You do not need to include all H2 headings.
44-
Leave out the prerequisites, clean-up resources and next steps--->
45-
46-
If you don't have a <service> subscription, create a free trial account...
47-
<!--- Required, if a free trial account exists
48-
Because tutorials are intended to help new customers use the product or
49-
service to complete a top task, include a link to a free trial before the
50-
first H2, if one exists. You can find listed examples in
51-
[Write tutorials](contribute-how-to-mvc-tutorial.md)
52-
--->
53-
54-
<!---Avoid notes, tips, and important boxes. Readers tend to skip over
55-
them. Better to put that info directly into the article text.--->
32+
Create a VuePress app from the Command Line Interface (CLI):
5633

57-
## Prerequisites
34+
1. Create a new folder for the VuePress app.
5835

59-
- First prerequisite
60-
- Second prerequisite
61-
- Third prerequisite
62-
<!---If you need them, make Prerequisites your first H2 in a tutorial. If
63-
there's something a customer needs to take care of before they start (for
64-
example, creating a VM) it's OK to link to that content before they
65-
begin.--->
66-
67-
## Sign in to <service/product/tool name>
68-
69-
Sign in to the <service> portal.
70-
<!---If you need to sign in to the portal to do the tutorial, this H2 and
71-
link are required.--->
72-
73-
## Procedure 1
74-
75-
<!---Required:
76-
Tutorials are prescriptive and guide the customer through an end-to-end
77-
procedure. Make sure to use specific naming for setting up accounts and
78-
configuring technology.
79-
Don't link off to other content - include whatever the customer needs to
80-
complete the scenario in the article. For example, if the customer needs
81-
to set permissions, include the permissions they need to set, and the
82-
specific settings in the tutorial procedure. Don't send the customer to
83-
another article to read about it.
84-
In a break from tradition, do not link to reference topics in the
85-
procedural part of the tutorial when using cmdlets or code. Provide customers what they need to know in the tutorial to successfully complete
86-
the tutorial.
87-
For portal-based procedures, minimize bullets and numbering.
88-
For the CLI or PowerShell based procedures, don't use bullets or
89-
numbering.
90-
--->
91-
92-
Include a sentence or two to explain only what is needed to complete the
93-
procedure.
94-
95-
1. Step 1 of the procedure
96-
1. Step 2 of the procedure
97-
1. Step 3 of the procedure
98-
99-
<!---Use screenshots but be judicious to maintain a reasonable length.
100-
Make sure screenshots align to the
101-
[current standards](https://review.docs.microsoft.com/help/contribute/contribute-how-to-create-screenshot?branch=master).
102-
If users access your product/service via a web browser the first
103-
screenshot should always include the full browser window in Chrome or
104-
Safari. This is to show users that the portal is browser-based - OS
105-
and browser agnostic.--->
106-
1. Step 4 of the procedure
107-
108-
## Procedure 2
109-
110-
Include a sentence or two to explain only what is needed to complete the procedure.
111-
112-
1. Step 1 of the procedure
113-
1. Step 2 of the procedure
114-
1. Step 3 of the procedure
115-
116-
## Procedure 3
117-
118-
Include a sentence or two to explain only what is needed to complete the
119-
procedure.
120-
<!---Code requires specific formatting. Here are a few useful examples of
121-
commonly used code blocks. Make sure to use the interactive functionality
122-
where possible.
123-
124-
For the CLI or PowerShell based procedures, don't use bullets or
125-
numbering.
126-
--->
127-
128-
Here is an example of a code block for Java:
129-
130-
```java
131-
cluster = Cluster.build(new File("src/remote.yaml")).create();
132-
...
133-
client = cluster.connect();
134-
```
135-
136-
or a code block for Azure CLI:
137-
138-
```azurecli-interactive
139-
az vm create --resource-group myResourceGroup --name myVM --image win2016datacenter --admin-username azureuser --admin-password myPassword12
140-
```
141-
142-
or a code block for Azure PowerShell:
143-
144-
```azurepowershell-interactive
145-
New-AzureRmContainerGroup -ResourceGroupName myResourceGroup -Name mycontainer -Image microsoft/iis:nanoserver -OsType Windows -IpAddressType Public
146-
```
147-
148-
149-
## Clean up resources
150-
151-
If you're not going to continue to use this application, delete
152-
<resources> with the following steps:
153-
154-
1. From the left-hand menu...
155-
2. ...click Delete, type...and then click Delete
156-
157-
<!---Required:
158-
To avoid any costs associated with following the tutorial procedure, a
159-
Clean up resources (H2) should come just before Next steps (H2)
160-
--->
36+
```bash
37+
mkdir static-site
38+
```
16139

162-
## Next steps
40+
1. Add a _README.md_ file the folder.
41+
42+
```bash
43+
echo '# Hello From VuePress' > README.md
44+
```
45+
46+
1. Initialize the _package.json_ file.
47+
48+
```bash
49+
npm init -y
50+
```
51+
52+
1. Add VuePress as a `devDependency`.
53+
54+
```bash
55+
npm install --save-dev vuepress
56+
```
57+
58+
1. Open the _package.json_ file in a text editor and add a build command to the [`scripts`](https://docs.npmjs.com/cli-commands/run-script.html) section.
59+
60+
```json
61+
...
62+
"scripts": {
63+
"build": "vuepress build"
64+
}
65+
...
66+
```
67+
68+
1. Create a _.gitignore_ file to exclude the _node\_modules_ folder.
69+
70+
```bash
71+
echo 'node_modules' > .gitignore
72+
```
73+
74+
1. Initialize a git repo.
75+
76+
```bash
77+
git init
78+
git add -A
79+
git commit -m "initial commit"
80+
```
81+
82+
## Push your application to GitHub
83+
84+
You need a repository on GitHub to connect to Azure Static Web Apps. The following steps show you how to create a repository for your site.
85+
86+
1. Create a blank GitHub repo (don't create a README) from [https://github.com/new](https://github.com/new) named **vuepress-static-app**.
87+
88+
1. Add the GitHub repository as a remote to your local repo. Make sure to add your GitHub username in place of the `<YOUR_USER_NAME>` placeholder in the following command.
89+
90+
```bash
91+
git remote add origin https://github.com/<YOUR_USER_NAME>/vuepress-static-app
92+
```
93+
94+
1. Push your local repo up to GitHub.
95+
96+
```bash
97+
git push --set-upstream origin master
98+
```
99+
100+
## Deploy your web app
101+
102+
The following steps show you how to create a new Static Web Apps application and deploy it to a production environment.
103+
104+
### Create the application
105+
106+
1. Navigate to the [Azure portal](https://portal.azure.com).
163107
164-
<!-- Uncomment this block and add the appropriate link
108+
1. Select **Create a Resource** and search for **Static Web Apps**.
109+
110+
:::image type="content" source="./media/static-web-apps-publish-vuepress/create-in-portal.png" alt-text="Create a Static Web Apps (Preview) in the portal":::
111+
112+
1. For **Subscription**, accept the subscription that is listed or select a new one from the drop-down list.
113+
114+
1. In _Resource group_, select **New**. In _New resource group name_, enter **vuepress-static-app** and select **OK**.
115+
116+
1. Next, provide a globally unique name for your app in the **Name** box. Valid characters include `a-z`, `A-Z`, `0-9` and `-`. This value is used as the URL prefix for your static app in the format of `https://<APP_NAME>.azurestaticapps.net`.
117+
118+
1. For _Region_, select an available region close to you.
119+
120+
1. For _SKU_, select **Free**.
121+
122+
:::image type="content" source="./media/static-web-apps-publish-vuepress/basic-app-details.png" alt-text="Details filled out":::
123+
124+
1. Click the **Sign in with GitHub** button.
125+
126+
1. Select the **Organization** under which you created the repo.
127+
128+
1. Select the **vuepress-static-app** as the _Repository_ .
129+
130+
1. For the _Branch_ select **master**.
131+
132+
:::image type="content" source="./media/static-web-apps-publish-vuepress/completed-github-info.png" alt-text="Completed GitHub information":::
133+
134+
### Build
135+
136+
Next, you add configuration settings that the build process uses to build your app. The following settings configure the GitHub Action workflow file.
137+
138+
1. Click the **Next: Build >** button to edit the build configuration
139+
140+
1. Set _App location_ to **/**.
141+
142+
1. Set _App artifact location_ to **.vuepress/dist**.
143+
144+
A value for _API location_ isn't necessary as you aren't deploying an API at the moment.
145+
146+
:::image type="content" source="./media/static-web-apps-publish-vuepress/build-details.png" alt-text="Build Settings":::
147+
148+
### Review and create
149+
150+
1. Click the **Review + Create** button to verify the details are all correct.
151+
152+
1. Click **Create** to start the creation of the Azure Static Web Apps and provision a GitHub Action for deployment.
153+
154+
1. Once the deployment completes click, **Go to resource**.
155+
156+
1. On the resource screen, click the _URL_ link to open your deployed application. You may need to wait a minute or two for the GitHub Action to complete.
157+
158+
:::image type="content" source="./media/static-web-apps-publish-vuepress/deployed-app.png" alt-text="Deployed application":::
159+
160+
### Clean up resources
161+
162+
[!INCLUDE [static-web-apps-cleanup-resource](../../includes/static-web-apps-cleanup-resource.md)]
163+
164+
## Next steps
165165
166166
> [!div class="nextstepaction"]
167-
> [Next steps button](contribute-get-started-mvc.md)
168-
169-
-->
170-
171-
<!--- Required:
172-
Tutorials should always have a Next steps H2 that points to the next
173-
logical tutorial in a series, or, if there are no other tutorials, to
174-
some other cool thing the customer can do. A single link in the blue box
175-
format should direct the customer to the next article - and you can
176-
shorten the title in the boxes if the original one doesn't fit.
177-
Do not use a "More info section" or a "Resources section" or a "See also
178-
section". --->
167+
> [Add a custom domain](custom-domain.md)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
author: aaronpowell
3+
ms.service: static-web-apps
4+
ms.topic: include
5+
ms.date: 05/08/2020
6+
ms.author: aapowell
7+
---
8+
9+
If you're not going to continue to use this application, you can delete the Azure Static Web App resource through the following steps:
10+
11+
1. Open the [Azure portal](https://portal.azure.com)
12+
1. In the top search bar, search for your application by the name you provided earlier
13+
1. Click on the app
14+
1. Click on the **Delete** button
15+
1. Click **Yes** to confirm the delete action

0 commit comments

Comments
 (0)