From be354f1063eae0d5775f3e42a62f64e62affbe69 Mon Sep 17 00:00:00 2001 From: Cliff Su Date: Sun, 24 Dec 2023 19:55:41 +0800 Subject: [PATCH] ci: update main_etf-line-bot.yml --- .github/workflows/main_etf-line-bot.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main_etf-line-bot.yml b/.github/workflows/main_etf-line-bot.yml index 2a9678a..f07e5ad 100644 --- a/.github/workflows/main_etf-line-bot.yml +++ b/.github/workflows/main_etf-line-bot.yml @@ -1,6 +1,3 @@ -# 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 - etf-line-bot on: @@ -20,12 +17,14 @@ jobs: uses: actions/setup-node@v3 with: node-version: '18.x' + - name: Init - Set up yarn environment + run: npm install -g yarn + + - name: Install dependencies + run: yarn - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm run test --if-present + - name: Unit Test + run: yarn test - name: Zip artifact for deployment run: zip release.zip ./* -r @@ -42,7 +41,7 @@ jobs: environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - + steps: - name: Download artifact from build job uses: actions/download-artifact@v3 @@ -51,12 +50,12 @@ jobs: - name: Unzip artifact for deployment run: unzip release.zip - + - name: 'Deploy to Azure Web App' id: deploy-to-webapp uses: azure/webapps-deploy@v2 with: app-name: 'etf-line-bot' slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5DE763F985CE44F9B4B74971DA82D0C2 }} package: . - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5DE763F985CE44F9B4B74971DA82D0C2 }} \ No newline at end of file