Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into which-vs-that
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwade committed Jun 13, 2024
2 parents f79abe4 + 62fb0d9 commit b582531
Show file tree
Hide file tree
Showing 39 changed files with 4,386 additions and 2,849 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
groups:
github-actions:
patterns:
- '*'
8 changes: 4 additions & 4 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.x'
- run: npm install
Expand All @@ -28,5 +28,5 @@ jobs:
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: gautamkrishnar/keepalive-workflow@14b7c72e9af14bddbbc1022a6f0bd20b1eac2619 # v2.0.0
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: gautamkrishnar/keepalive-workflow@05456e7809058d586d96392e99217726ccc10076 # v2.0.5
76 changes: 76 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Deploy to Azure

on:
push:
branches:
- master
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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Build zip
run: npm run bundle

- name: Create zip
run: zip -r ${{ env.FUNCTION_ZIP_NAME }} dist host.json package.json

- name: Upload artifact for deployment job
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: node-app
path: ${{ env.FUNCTION_ZIP_NAME }}

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
permissions:
id-token: write

steps:
- name: Download artifact from build job
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: node-app

- uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1
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 }}
79 changes: 0 additions & 79 deletions .github/workflows/master_dtmergebot2.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/print-tree.js

This file was deleted.

27 changes: 22 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
name: CI
on: pull_request

defaults:
run:
shell: bash

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.x'
- run: npm install
- run: npm run lint
- run: npx knip
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.x'
- run: npm install
- run: npm run build
- run: npm test
- run: npm prune --production
- run: |
export BOT_AUTH_TOKEN=secret
for i in dist/functions/*.js; do
node $i;
done
15 changes: 15 additions & 0 deletions .knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"src/run.ts",
"src/commands/*.ts",
"src/functions/*.ts",
"src/scripts/*.ts",
"src/_tests/testEnvironment.js"
],
"project": [
"**/*.{js,ts,tsx}"
],
"ignore": ["src/queries/schema/**", "dist/**"],
"ignoreExportsUsedInFile": true
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"problemMatcher": []
}
]
}
}
Loading

0 comments on commit b582531

Please sign in to comment.