Skip to content

Commit

Permalink
Merge pull request #244 from ThatConference/fileUpload/chore/node-20
Browse files Browse the repository at this point in the history
chore: configure for node 20
  • Loading branch information
brettski authored Dec 1, 2023
2 parents c399477 + d73f3ce commit ffca439
Show file tree
Hide file tree
Showing 7 changed files with 7,814 additions and 8,349 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/fileUpload_PullRequest.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: fileUpload Pull Request
name: fileUpload Pull Request

on:
on:
pull_request:
paths:
- 'functions/fileUpload/**'
- "functions/fileUpload/**"

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout PR
uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v1
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- name: npm ci, run validate
run: |
cd functions/fileUpload
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/fileUpload_PushMaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ on:
jobs:
build:
name: Build File Upload
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v1
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- name: npm ci, run validate
run: |
cd functions/fileUpload
Expand All @@ -31,11 +31,12 @@ jobs:
run: |
cd functions/fileUpload
pwd
npm pkg delete scripts.build
cp ./package.json __build__/
cp ./package-lock.json __build__/
git rev-list --count master > __build__/ccnt.txt
- name: Archive Build Artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: tc-api
path: functions/fileUpload/__build__
Expand All @@ -53,17 +54,21 @@ jobs:
deploy-image:
name: Deploy Image Upload
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: tc-api
path: tc-api
- name: Setup google auth for github actions
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCLOUD_AUTH }}
- name: Setup gcloud Actions
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v1
with:
version: '397.0.0'
service_account_key: ${{ secrets.GCLOUD_AUTH }}
version: "437.0.1"
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: write .env file
run: |
Expand All @@ -73,7 +78,6 @@ jobs:
SENTRYREL=SENTRY_VERSION=that-imgage-upload@$(cat tc-api/package.json | jq '.version' | tr -d '"')-$C_CNT.$(echo $GITHUB_SHA | cut -c1-7)
echo "" >> tc-api/.env
echo $SENTRYREL >> tc-api/.env
# echo "::set-env name=SENTRYREL::$SENTRYREL"
echo "SENTRYREL=$SENTRYREL" >> $GITHUB_ENV
env:
CLOUDSDK_CORE_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
Expand All @@ -87,7 +91,7 @@ jobs:
echo $PWD
ls -lasiR
- name: Run GCP Deploy Function - imageUpload
run: gcloud functions deploy fileUploadGateway --allow-unauthenticated --runtime nodejs16 --trigger-http --source $PWD/tc-api --entry-point handler --memory 512MB
run: gcloud functions deploy fileUploadGateway --allow-unauthenticated --runtime nodejs20 --trigger-http --source $PWD/tc-api --entry-point handler --memory 512MB
env:
CLOUDSDK_CORE_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
- name: Slack Notification
Expand Down
2 changes: 1 addition & 1 deletion functions/fileUpload/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"jest/valid-expect": "error"
},
"plugins": ["jest"],
"parser": "babel-eslint"
"parser": "@babel/eslint-parser"
}
2 changes: 1 addition & 1 deletion functions/fileUpload/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.1
20.10.0
Loading

0 comments on commit ffca439

Please sign in to comment.