diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..05850558 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,69 @@ +name: Deploy docs site to Pages + +on: + push: + branches: + - main + paths: + - 'docs/**' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + run_install: false + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-docs-pnpm-store-${{ hashFiles('**/docs/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-docs-pnpm-store- + - name: Install dependencies + working-directory: docs + run: pnpm install + - name: Run build + working-directory: docs + run: pnpm docs:build + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0337c033..b83d5f74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,10 +6,13 @@ on: - main - stable paths-ignore: - - '**.md' + - 'docs/**' pull_request: branches: - main + paths-ignore: + - 'docs/**' + workflow_dispatch: jobs: build: diff --git a/client/src/components/HomeHeader.vue b/client/src/components/HomeHeader.vue index 7d2b4f2e..0229ee04 100644 --- a/client/src/components/HomeHeader.vue +++ b/client/src/components/HomeHeader.vue @@ -6,7 +6,12 @@ const authStore = useAuthStore() const authenticated = computed(() => authStore.authenticated) const authorized = computed(() => authStore.authorized) -const { t } = useI18n({ useScope: 'global' }) +const { t, locale } = useI18n({ useScope: 'global' }) + +const instructionsLink = computed(() => { + const localePath = locale.value === 'pt-BR' ? 'pt/' : '' + return `https://alessandrojean.github.io/toshokan/${localePath}guides/instructions` +})