diff --git a/.github/workflows/release-docs.yaml b/.github/workflows/release-docs.yaml index acf9f27..cfd7977 100644 --- a/.github/workflows/release-docs.yaml +++ b/.github/workflows/release-docs.yaml @@ -1,4 +1,4 @@ -name: Release +name: Docs on: push: @@ -30,7 +30,7 @@ jobs: - name: Deploy to Netlify uses: flowexec/action@v1 with: - executable: 'deploy docs:netlify ${{ github.event.inputs.environment || 'production' }}' + executable: "deploy docs:netlify ${{ github.event.inputs.environment || 'production' }}" timeout: '5m' flow-version: 'main' secrets: | diff --git a/docs/docs.flow b/docs/docs.flow index d664958..1026b5a 100644 --- a/docs/docs.flow +++ b/docs/docs.flow @@ -19,8 +19,22 @@ executables: - envKey: NETLIFY_SITE_ID secretRef: netlify-flow-site-id cmd: | + # Generate deploy message from git log + COMMIT_SHA=$(git rev-parse --short HEAD) + COMMIT_MSG=$(git log -1 --pretty=%s) + BRANCH=$(git rev-parse --abbrev-ref HEAD) + + # Check if branch is dirty + if ! git diff-index --quiet HEAD --; then + DIRTY=" (dirty)" + else + DIRTY="" + fi + + MESSAGE="${BRANCH}@${COMMIT_SHA}${DIRTY}: ${COMMIT_MSG}" + if [ "${ENVIRONMENT}" = "production" ]; then - npx netlify-cli deploy --dir=dist --prod + npx netlify-cli deploy --dir=dist --prod --message="${MESSAGE}" else - npx netlify-cli deploy --dir=dist + npx netlify-cli deploy --dir=dist --message="${MESSAGE}" fi