Bump gautamkrishnar/keepalive-workflow from 2.0.7 to 2.0.8 in the git… #354
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
name: Deploy mergebot to Azure | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
NODE_VERSION: '18.x' # set this to the node version to use (supports 8.x, 10.x, 12.x) | |
RESOURCE_GROUP_NAME: dtmergebot3 | |
FUNCTION_APP_NAME: dtmergebot3 | |
STORAGE_ACCOUNT_NAME: dtmergebot3b1b7 | |
STORAGE_CONTAINER_NAME: deployment | |
FUNCTION_ZIP_NAME: function.zip | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | |
- name: Install and test | |
run: | | |
pnpm install | |
pnpm run --if-present build | |
pnpm run --if-present test | |
- name: Bundle | |
working-directory: packages/mergebot | |
run: pnpm run bundle | |
- name: Check bundle | |
run: BOT_AUTH_TOKEN=secret node packages/mergebot/dist/functions/index.js | |
- name: Create zip | |
working-directory: packages/mergebot | |
run: zip -r ${{ github.workspace }}/${{ env.FUNCTION_ZIP_NAME }} dist host.json package.json | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: node-app | |
path: ${{ env.FUNCTION_ZIP_NAME }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: 'Production' | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: node-app | |
- uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Upload blob | |
run: az storage blob upload -f ${{ env.FUNCTION_ZIP_NAME }} --account-name ${{ env.STORAGE_ACCOUNT_NAME }} -c ${{ env.STORAGE_CONTAINER_NAME }} -n ${{ env.FUNCTION_ZIP_NAME }} --overwrite true --auth-mode login | |
# - name: Set package path | |
# run: az functionapp config appsettings set -g ${{ env.RESOURCE_GROUP_NAME }} -n ${{ env.FUNCTION_APP_NAME }} --settings WEBSITE_RUN_FROM_PACKAGE="https://${{ env.STORAGE_ACCOUNT_NAME }}.blob.core.windows.net/${{ env.STORAGE_CONTAINER_NAME }}/${{ env.FUNCTION_ZIP_NAME }}" | |
- name: Restart app | |
run: az functionapp restart -g ${{ env.RESOURCE_GROUP_NAME }} -n ${{ env.FUNCTION_APP_NAME }} |