diff --git a/.github/workflows/lint.yml b/.github/workflows/languages-sync.yml similarity index 52% rename from .github/workflows/lint.yml rename to .github/workflows/languages-sync.yml index 8efce5cbd4..33b0b79e93 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/languages-sync.yml @@ -1,10 +1,17 @@ -name: Lint +name: Languages Sync on: push: - branches: [master] - # pull_request: - # branches: [master] + branches: [ "develop", "master" ] + paths: + - 'libs/datasource/i18n/**' + - '.github/workflows/languages-sync.yml' + pull_request: + branches: [ "develop", "master" ] + paths: + - 'libs/datasource/i18n/**' + - '.github/workflows/languages-sync.yml' + workflow_dispatch: # Cancels all previous workflow runs for pull requests that have not completed. # See https://docs.github.com/en/actions/using-jobs/using-concurrency @@ -18,11 +25,9 @@ jobs: main: strategy: matrix: - node-version: [16] + node-version: [18] os: [ubuntu-latest] runs-on: ${{ matrix.os }} - # TODO Remove the next line after cleaning all errors - continue-on-error: true steps: - name: Checkout @@ -43,20 +48,16 @@ jobs: - name: Install node modules run: pnpm install - - name: Lint - if: always() - run: pnpm run lint:with-cache + - name: Check Language Key + if: github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' + working-directory: ./libs/datasource/i18n + run: pnpm run sync-languages:check + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} - # - name: Check - # if: always() - # run: pnpm run check - - # - name: Format Check - # if: always() - # run: pnpm run format:ci - - # - name: Build - # run: pnpm run build - - # - name: Test - # run: pnpm run test + - name: Sync Languages + if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' + working-directory: ./libs/datasource/i18n + run: pnpm run sync-languages + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} diff --git a/.github/workflows/livedemo.yml b/.github/workflows/livedemo.yml new file mode 100644 index 0000000000..d5ed5b9987 --- /dev/null +++ b/.github/workflows/livedemo.yml @@ -0,0 +1,87 @@ +name: Build AFFiNE-Local + +on: + push: + branches: [master] + # pull_request: + # branches: [master] + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +env: + REGISTRY: ghcr.io + NAMESPACE: toeverything + AFFINE_IMAGE_NAME: LIVEDEMO + IMAGE_TAG_LATEST: nightly-latest + LOCAL_CACHE: localhost:5000/toeverything/relocate:latest + +jobs: + ligo-virgo: + runs-on: self-hosted + environment: development + permissions: + contents: read + packages: write + + services: + registry: + image: registry:2 + ports: + - 5000:5000 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: network=host + + - name: Extract metadata (tags, labels) for Docker (AFFiNE-Local) + id: meta_affine + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.AFFINE_IMAGE_NAME }} + tags: ${{ env.IMAGE_TAG_LATEST }} + + - name: Build and push Docker image (AFFINE-Local) + uses: docker/build-push-action@v3 + env: + HUBSPOT_API_SECRET: ${{ secrets.SuperSecret }} + with: + context: . + push: true + file: ./.github/deployment/Dockerfile-affine + tags: ${{ env.LOCAL_CACHE }} + target: AFFiNE + + - name: Build and push Docker image (AFFINE-Local) + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64/v8 + file: ./.github/deployment/Dockerfile-affine-multiplatform + push: ${{ github.ref == 'refs/heads/master' && true || false }} + tags: ${{ steps.meta_affine.outputs.tags }} + labels: ${{ steps.meta_affine.outputs.labels }} + target: AFFiNE + build-args: | + BASE_IMAGE=${{ env.LOCAL_CACHE }} diff --git a/apps/ligo-virgo/src/template.html b/apps/ligo-virgo/src/template.html index d0c4a84e0b..badce60082 100644 --- a/apps/ligo-virgo/src/template.html +++ b/apps/ligo-virgo/src/template.html @@ -4,6 +4,7 @@ <%= htmlWebpackPlugin.options.title %> + <%= htmlWebpackPlugin.options.hubspotScript %>
diff --git a/apps/ligo-virgo/webpack.config.js b/apps/ligo-virgo/webpack.config.js index 11be2e1c76..377f32551a 100644 --- a/apps/ligo-virgo/webpack.config.js +++ b/apps/ligo-virgo/webpack.config.js @@ -12,6 +12,13 @@ const Style9Plugin = require('style9/webpack'); const enableBundleAnalyzer = process.env.BUNDLE_ANALYZER; +function generateHubspotScript() { + const hubspotApiSecret = process.env.HUBSPOT_API_SECRET; + if (hubspotApiSecret) { + return ``; + } +} + module.exports = function (webpackConfig) { const config = getNxWebpackConfig(webpackConfig); @@ -175,6 +182,7 @@ module.exports = function (webpackConfig) { ), //favicon path template: path.resolve(__dirname, './src/template.html'), publicPath: '/', + hubspotScript: generateHubspotScript(), }), new Style9Plugin(), isProd && diff --git a/apps/venus/src/app/IndexPage/Alternatives.tsx b/apps/venus/src/app/IndexPage/Alternatives.tsx index 17403e01c9..4c7645a9d8 100644 --- a/apps/venus/src/app/IndexPage/Alternatives.tsx +++ b/apps/venus/src/app/IndexPage/Alternatives.tsx @@ -7,7 +7,7 @@ import { useMediaQuery } from '@mui/material'; const Alternatives = styled(Box)<{ width: string }>(({ width }) => ({ position: 'relative', - width: '20em', + width: '24em', height: '128px', transform: 'translateY(-8px)', overflowY: 'hidden', @@ -21,7 +21,7 @@ const Alternatives = styled(Box)<{ width: string }>(({ width }) => ({ height: 'inherit', position: 'absolute', left: '0', - top: '0', + top: '-23px', paddingTop: '22px', lineHeight: '96px', '@media (max-width: 1024px)': { @@ -105,7 +105,7 @@ export const AlternativesProduct = () => { )} > { }} > - + { window.open(href); }} /> - { - window.open(href); - }} - />