Skip to content

Commit

Permalink
feat: add deploy workflow to dist branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianoayres committed Jul 9, 2024
1 parent c6b7e54 commit 3633af4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to dist branch

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Switch to dist branch
run: |
git fetch
git switch dist || git checkout -b dist
- name: Move content from src to root
run: |
mv ./src/* ./
rm -rf ./src
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Move content from src to root"
git push origin dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3633af4

Please sign in to comment.