This file contains hidden or 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
| import { ServerRequest } from "https://deno.land/std@0.58.0/http/server.ts"; | |
| export default async (req: ServerRequest) => { | |
| req.respond({ body: `Hello, from Deno v${Deno.version.deno}!` }); | |
| } |
This file contains hidden or 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
| <p>You are visitor number: <span id='visitorCount'></span></p> |
This file contains hidden or 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
| fetch("/count") | |
| .then(response => response.json()) | |
| .then(count => { | |
| document.getElementById("visitorCount").innerHTML = count; | |
| }); |
This file contains hidden or 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
| const { Firestore, FieldValue } = require("@google-cloud/firestore"); | |
| const credentials = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT); | |
| const db = new Firestore({ projectId: credentials.project_id, credentials }); | |
| const docRef = db.collection("counters").doc("visitors"); | |
| docRef.set({}, { merge: true }) | |
| const incrementAndGetVisitorCount = async () => | |
| docRef |
This file contains hidden or 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
| const credentials = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT); | |
| const { Firestore } = require("@google-cloud/firestore"); | |
| const db = new Firestore({ projectId: credentials.project_id, credentials }); |
This file contains hidden or 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
| const Firestore = require("@google-cloud/firestore"); | |
| let credentials = {}; | |
| try { | |
| credentials = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT); | |
| } catch { | |
| console.error("Could not parse process.env.FIREBASE_SERVICE_ACCOUNT"); | |
| } |
This file contains hidden or 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
| FIREBASE_SERVICE_ACCOUNT='{ | |
| "type": "service_account", | |
| "project_id": "charmed-cultured-cupcake", | |
| "private_key_id": "-----REDACTED-----", | |
| "private_key": "-----BEGIN PRIVATE KEY-----\n-----REDACTED-----\n-----END PRIVATE KEY-----\n", | |
| "client_email": "firebase-adminsdk-522mn@charmed-cultured-cupcakee.iam.gserviceaccount.com", | |
| "client_id": "-----REDACTED-----", | |
| "auth_uri": "https://accounts.google.com/o/oauth2/auth", | |
| "token_uri": "https://oauth2.googleapis.com/token", | |
| "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", |
This file contains hidden or 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
| cask 'chuck-wagon' do | |
| version 'x.x.x' | |
| sha256 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
| url "https://github.com/<username>/chuck-wagon/releases/download/v#{version}/Chuck_Wagon.dmg" | |
| appcast 'https://github.com/<username>/chuck-wagon/releases.atom' | |
| name 'Chuck Wagon' | |
| homepage 'https://github.com/<username>/chuck-wagon' | |
| app 'Chuck Wagon.app' |
This file contains hidden or 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
| cask 'mac-app-devops-demo' do | |
| version 'x.x.x' | |
| sha256 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
| url "https://github.com/bacongravy/mac-app-devops-demo/releases/download/v#{version}/mac-app-devops-demo.dmg" | |
| appcast 'https://github.com/bacongravy/mac-app-devops-demo/releases.atom' | |
| name 'mac-app-devops-demo' | |
| homepage 'https://github.com/bacongravy/mac-app-devops-demo' | |
| depends_on macos: '>= :catalina' |
This file contains hidden or 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: master_deploy | |
| on: | |
| push: | |
| tags: [ v* ] | |
| jobs: | |
| master_deploy: | |
| runs-on: macos-latest |