version: 1
kind: pipeline
spec:
  stages:
    - name: build
      type: ci
      spec:
        steps:
          - name: debug
            type: run
            spec:
              name: debug
              container: alpine/git
              shell: sh
              script: |
                echo build.event = ${{ build.event }}
                echo build.target = ${{ build.target }}
          - name: lint
            type: run
            spec:
              name: lint
              container: jdkato/vale
              shell: sh
              script: |
                set -x
                set -e
                f=$(mktemp)
                cat open-resume.com.d/local-storage-about-srcdoc-open-resume.json | sed 's/"[^"]*":/"."/g' > $f
                vale sync
                vale $f || true
          - name: build
            type: run
            when: build.event == "push" && build.target == "main"
            spec:
              name: build
              container: andreysenov/firebase-tools
              shell: sh
              script: |
                bash ./deploy.firebase.sh '${{
                secrets.get("resume-firebase-squeaky2x3-gmail-token") }}'
