Skip to content
Merged

Dev #75

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,36 @@ jobs:
- name: 'Build application'
run: npm run build

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'build: build application'
fetch: false
- name: 'Fetch branches'
run: git fetch origin

- name: 'Set Git user name and email'
run: |
git config --local user.email "github-actions@github.com"
git config --local user.name "GitHub Actions"

- name: Fetch branches and create gh-pages branch
- name: 'Resolve merge conflicts if any'
run: |
git checkout main
git fetch origin

- name: Copy to temp-directory
git reset --hard origin/main

- name: 'Copy build artifacts to gh-pages branch'
run: |
mkdir /tmp/temp-directory
cp -r .next/* /tmp/temp-directory/
git checkout gh-pages
git rm -rf .
cp -r /tmp/temp-directory/ .
git add temp-directory/
git commit -m "Copy main-folder to gh-pages branch"
git add temp-directory/
git commit -m "Copy build artifacts from main to gh-pages branch"

- name: Push to gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin gh-pages

- name: 'Switch back to main branch'
run: |
git checkout main