jemluz / ds-ignite-call

https://jemluz.github.io/ds-ignite-call/
1 stars 0 forks source link

Publicação e manutenção #5

Open jemluz opened 2 months ago

jemluz commented 2 months ago

Publicando StoryBook

Vamos usar a biblioteca Storybook Deployer para otimizar nosso processo de publicação

Criado o arquivo deploy-docs.yml par configurar a pipeline/rotina de deploy do storbook

name: Deploy docs

# the pipe will be run everytime that master branch has a push
on:
  push:
    branches:
      - master

# define steps of pipeline
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout # do checkout to get the code
        uses: actions/checkout@v4

      - name: Setup Node.js #  install node
        uses: actions/setup-node@v4
        with:
          node-version: 18

      - run: npm ci # do npm install (made by ci environment, what will isnt modify the package-lock, this is important!)

      - run: npm run build # run turborepo build

      - name: Deploy storybook # do deploy
        working-directory: ./packages/docs # enter on storybook folder
        run: touch storybook-static/.nojekyll && npm run deploy-storybook -- --ci --existing-output-dir=storybook-static # run deploy command
        env:
          GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}

Precisei utilizar as issues Erro ao visualizar a página publicada do storybook e Erro no deploy do Storybook url retorna erro 403 para deixar o deploy redondinho

Também teve a configuração do GH Pages para gerar a pipe de hospedagem image

jemluz commented 2 months ago

Cache no GitHub Actions

Configuramos o cache da build image

E tbm o cache do npm image

image image

Olha só, reduziu o tempo pela metade image