Skip to content

Release

Release #380

Workflow file for this run

name: Release
on:
push:
tags:
- "*.*"
branches:
- master
schedule:
- cron: '0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
label-detector:
name: Runner Label
runs-on: label-detector
outputs:
runs-on: ${{ steps.detector.outputs.label }}
steps:
- name: Detect Label
id: detector
run: |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs
echo "label=$(curl -fsSL https://this-is-nats.appscode.ninja/runs-on/${{ github.repository_owner }}?visibility=${{ github.repository_visibility }})" >> $GITHUB_OUTPUT
build:
name: Build
needs: label-detector
runs-on: "${{ needs.label-detector.outputs.runs-on }}"
steps:
- uses: actions/checkout@v1
- name: Check tag matches package version
run: |
PKG_VERSION=$(jq -r '.version' package.json)
GIT_TAG=$(git describe --exact-match --abbrev=0 2>/dev/null || echo "")
test "v${PKG_VERSION}" = "${GIT_TAG}"
- name: Prepare git
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
set -x
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_USER}@appscode.com"
git config --global \
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
"https://github.com"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install Firebase CLI
run: |
npm i -g firebase-tools@v11.14.1
# - name: QA
# env:
# FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.'))
# run: |
# npm install
# npm run deploy:qa
- name: Release
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) == false
run: |
npm install
npm run deploy:prod
- name: Update search index
env:
MEILISEARCH_ADMIN_API_KEY: ${{ secrets.MEILISEARCH_ADMIN_API_KEY }}
if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) == false
run: |
curl \
-X POST 'https://search.docs.appscode.com/indexes' \
-H "Authorization: Bearer $MEILISEARCH_ADMIN_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{
"uid": "acedocs",
"primaryKey": "documentId"
}'
curl \
-X POST 'https://search.docs.appscode.com/indexes/acedocs/documents' \
-H "Authorization: Bearer $MEILISEARCH_ADMIN_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @.vitepress/dist/index.json