Skip to content

Commit

Permalink
fix: Corrige o arquivo de deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
sidartaveloso committed Oct 17, 2024
1 parent 3fa257d commit 30fce18
Showing 1 changed file with 64 additions and 16 deletions.
80 changes: 64 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,115 @@ name: Test and Deploy Package
on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read # for checkout
contents: write # for publishing releases
issues: write # for commenting on released issues
pull-requests: write # for commenting on released pull requests
pages: write # for deploying to GitHub Pages
id-token: write # for deploying to GitHub Pages

# Allow only one concurrent deployment
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full repository is checked out, not just a shallow clone
fetch-depth: 0

- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint

- name: Build
run: yarn build

- name: Test
run: yarn test:unit

release:
needs: build
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full repository is checked out, not just a shallow clone
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Update repository to latest version
run: git pull origin main

- name: Build package
run: yarn build

- name: Release package
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 19
extra_plugins: |
@semantic-release/git@10.0.1
@semantic-release/github@10.1.0
@semantic-release/npm@12.0.1
branches: |
['main']
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }}
- name: Build storybook

deploy-storybook:
needs: release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build Storybook
run: yarn build:storybook
- name: Deploy storybook
uses: peaceiris/actions-gh-pages@v4

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static/
path: storybook-static

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 30fce18

Please sign in to comment.