fix: Cat build env file #8
This file contains 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
# File: .github/workflows/workflow.yml | |
name: JavaScript CI | |
on: [push] | |
env: | |
AZURE_WEBAPP_NAME: devjam-spotify-track-analysis # set this to your application's name | |
AZURE_WEBAPP_PACKAGE_PATH: "build" # set this to the path to your web app project, defaults to the repository root | |
NODE_VERSION: "18.x" # set this to the node version to use | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: npm install, build, and test | |
run: | | |
# Build and test the project, then | |
# deploy to Azure Web App. | |
npm install | |
npm run build --if-present | |
npm run test --if-present | |
- name: copy env file | |
run: | | |
# Create env | |
touch ./build/.env | |
echo SPOTIFY_CLIENT_ID=${{ secrets.SPOTIFY_CLIENT_ID }} >> ./build/.env | |
echo SPOTIFY_CLIENT_SECRET=${{ secrets.SPOTIFY_CLIENT_SECRET }} >> ./build/.env | |
cat ./build/.env | |
working-directory: "." | |
- name: "Deploy to Azure WebApp" | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }} | |
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |