From 3633af4cb92667e8bb8ed3361ebc8999c82a64df Mon Sep 17 00:00:00 2001 From: Luciano Ayres Date: Tue, 9 Jul 2024 12:05:07 -0300 Subject: [PATCH] feat: add deploy workflow to dist branch --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..4f0ea89 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 }}