Skip to content

Fix: bad yml formatting #13

Fix: bad yml formatting

Fix: bad yml formatting #13

Workflow file for this run

name: CD
on:
push:
branches:
- main
tags:
- v*.*.**
jobs:
test:
concurrency:
group: test
cancel-in-progress: true
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable --prod=false
- run: yarn install --immutable --prod=false
working-directory: functions
- run: yarn run lint
# test_functions:
# concurrency:
# group: test-functions
# cancel-in-progress: true
# runs-on: ubuntu-latest
# timeout-minutes: 10
# defaults:
# run:
# working-directory: functions
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: 'yarn'
# - run: yarn install --immutable
# - run: yarn run lint
build:
needs: test
concurrency:
group: build
cancel-in-progress: true
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run build
- name: Tar files
run: tar -cvzf apps.tar.gz ./dist .firebaserc database.rules.json firebase.json storage.rules
- uses: actions/upload-artifact@v3
with:
name: apps-builds
path: apps.tar.gz
retention-days: 1
# build_functions:
# needs: test_functions
# concurrency:
# group: build-functions
# cancel-in-progress: true
# runs-on: ubuntu-latest
# timeout-minutes: 10
# defaults:
# run:
# working-directory: functions
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: 'yarn'
# - run: yarn install --immutable
# - run: yarn run build
# - name: Tar files
# run: tar -cvzf functions.tar.gz ./dist .firebaserc database.rules.json firebase.json storage.rules
# - uses: actions/upload-artifact@v3
# with:
# name: functions-builds
# path: functions.tar.gz
# retention-days: 1
release:
if: github.ref_type == 'tag'
needs:
- build
# - build_functions
concurrency:
group: release
cancel-in-progress: true
permissions:
contents: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/download-artifact@v3
with:
name: apps-builds
- uses: actions/download-artifact@v3
with:
name: functions-builds
- uses: softprops/action-gh-release@v1
with:
files: ./**
deploy:
needs: build
concurrency:
group: deploy
cancel-in-progress: true
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: ${{ github.ref_type == 'tag' && 'Production' || 'Development' }}
steps:
- uses: actions/download-artifact@v3
with:
name: apps-builds
- run: tar -xvzf apps.tar.gz
- run: rm apps.tar.gz
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: '${{ vars.FIREBASE_CHANNEL }}'
projectId: '${{ vars.FIREBASE_PROJECT_ID }}'
target: '${{ vars.FIREBASE_TARGET }}'
# deploy_functions:
# if: github.ref_type == 'tag'
# needs: build_functions
# concurrency:
# group: deploy-functions
# cancel-in-progress: true
# runs-on: ubuntu-latest
# timeout-minutes: 5
# environment:
# name: 'Production'
# defaults:
# run:
# working-directory: functions
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: functions-builds
# - run: tar -xvzf functions.tar.gz
# - run: rm functions.tar.gz
# - run: yarn install firebase-tools
# - run: firebase deploy --token "${{ secrets.FIREBASE_CI_TOKEN }}" --only functions
# TODO: add db deployment