Azure / Azure/actions-workflow-samples

How to deploy a build folder generated during compilation outside the root repository using Azure's github action

Open
#31 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Pug
Stars
511
Forks
657
PR merge metrics
No merged PRs in 30d

Description

I have a repository with two folders in the root repository. One is for the frontend (React) and one for the backend.

I would like to deploy a build folder (the build folder is from the client folder) thats gets generated during the workflow job when running the command "npm build" inside the client directory. Is there any way i can grab that auto-generated folder instead of grabbing a folder from the repository itself?

Heres my current .yaml file:

```
# 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

on:
push:
paths-ignore:
- 'server/**' # Only trigger the deployment if the client folder changed, soo ignore the server folder changes
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

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

- name: npm install, build, and test
run: |
cd client
npm install
npm run build # I want to deploy the folder that this command generates!

- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v1
with:
app-name: 'my-monolithic-repository'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService }}
package: ./theGeneratedFolder # I want to grab the build folder that got created during this job and not grab a folder from the repository
```

I can only deploy the build folder with the latest changes if i push it to the repository and i would like to avoid building the web app and just deploy the folder that gets generated during this job. I cannot find a way to grab auto-generated files from this action. Sorry for my english and thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the workflow YAML shown in the issue and the azure/webapps-deploy action documentation. Run the client npm build step and inspect the generated output before the deployment step. Done means the workflow deploys that generated client folder without committing build artifacts to the repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions, node.js, react
Domain
cloud, devops, frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.