Skip to content
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

Create azure-webapps-node.yml #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
102 changes: 102 additions & 0 deletions .github/workflows/azure-webapps-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 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
#
Anda sekarang berada dalam slot produksi, yang tidak disarankan untuk membuat pengaturan CI/CD.Pelajari selengkapnya
Sebarkan dan buat kode dari penyedia sumber dan build pilihan Anda. Pelajari selengkapnya

Sumber*
Membangun dengan Tindakan GitHub.Ubah Penyedia.
GitHub
App Service akan menempatkan alur kerja GitHub Actions di repositori pilihan Anda untuk membangun dan menerapkan aplikasi setiap kali ada penerapan pada cabang yang dipilih. Jika tidak dapat menemukan organisasi atau repositori, Anda mungkin perlu mengaktifkan izin tambahan di GitHub. Anda harus memiliki akses tulis ke repositori GitHub pilihan Anda untuk disebarkan dengan GitHub Actions. Pelajari selengkapnya

Masuk sebagai
MarvelxvelUbah Akun
Organisasi*
Marvelxvel
Repositori*
startbootstrap-creative
Cabang*
master
Build
Runtime stack
Node
Versi
~18
Konfigurasi Alur Kerja
File dengan konfigurasi alur kerja yang telah ditentukan oleh pengaturan di atas.


Konfigurasi Alur Kerja
Jalur file: .github/workflows/main_Ethernetmarvelx.yml

Jika konfigurasi alur kerja sekarang sudah ada, maka akan ditimpa.
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Node.js app to Azure Web App - Ethernetmarvelx

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '18.x'

- 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@v2
with:
name: node-app
path: .

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

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

- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: 'Ethernetmarvelx'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_e7894aae55504e6f91d9bce9a4deb023 }}
package: .