From 145841fc4557f8316ff53643d6effd70fd58cc91 Mon Sep 17 00:00:00 2001 From: Mentor Palokaj Date: Sun, 17 Oct 2021 10:32:52 +0200 Subject: [PATCH] Functions ci --- .github/workflows/deploy-functions.yml | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy-functions.yml diff --git a/.github/workflows/deploy-functions.yml b/.github/workflows/deploy-functions.yml new file mode 100644 index 0000000..062f594 --- /dev/null +++ b/.github/workflows/deploy-functions.yml @@ -0,0 +1,43 @@ +name: Deploy function updates ( main ) + +on: + # Trigger: on new tag push + push: + branches: + - main + paths: + - '.github/workflows/deploy-minter.yml' + - 'functions/**' + +jobs: + build: + name: Publish changes + + runs-on: ubuntu-latest + + steps: + # Get the repo files from current commit + - name: Cloning repository + uses: actions/checkout@v1 + + # Install frontend dependencies based on nvmrc + - name: Read .nvmrc + run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" + id: nvmfunctions + working-directory: functions + + - name: Set Node.js (.nvmrc) + uses: actions/setup-node@v1 + with: + node-version: "${{ steps.nvmfunctions.outputs.NVMRC }}" + + - name: Install functions dependencies + run: npm i + working-directory: functions + + - name: Deploy to Firebase + uses: w9jds/firebase-action@master + with: + args: deploy --only=functions + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}