Skip to content

Commit

Permalink
ci: 🔧 Corrigido e ajustado workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
LiloMarino committed Oct 26, 2024
1 parent 5afe579 commit 50b8770
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ name: Deploy to GitHub Pages

on:
push:
branches:
- main
tags:
- 'v*' # Apenas aciona o deploy para tags que seguem o padrão v*

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Build project
run: npm run build
- name: Build project
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,38 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Verifica se houve alterações
if [ -n "$(git status --porcelain)" ]; then
git checkout -b release-update
git add CHANGELOG.md public/patch-notes.json
git commit -m "chore: update changelog and patch notes"
git push --set-upstream origin release-update
# Criar o pull request
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-d '{"title":"Release Update","body":"This pull request updates the changelog and patch notes.","head":"release-update","base":"main"}' \
https://api.github.com/repos/${{ github.repository }}/pulls
else
echo "No changes to commit."
fi

0 comments on commit 50b8770

Please sign in to comment.