Skip to content

Commit

Permalink
Merge branch 'development' into gantry_twist_beacon_scan_compensation
Browse files Browse the repository at this point in the history
  • Loading branch information
miklschmidt committed Dec 21, 2024
2 parents ec3b159 + a077b3f commit 92c29b3
Show file tree
Hide file tree
Showing 43 changed files with 6,357 additions and 279 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
workflow-id: publish-development.yml
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.variables.outputs.src-branch }}
branch: development # This has to be the main branch of repository since all workflows are run from there

- name: Get commit count
id: commit-count
Expand Down
73 changes: 56 additions & 17 deletions .github/workflows/publish-v2.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,34 @@ jobs:
run: |
echo "CI step didn't pass, exiting"
exit 1
- name: Set variables
id: variables
shell: bash
run: |
echo "target-branch=v2.1.x-deployment" >> "$GITHUB_OUTPUT"
echo "src-branch=v2.1.x" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v3
with:
ref: v2.1.x
ref: ${{ steps.variables.outputs.src-branch }}

- name: Unshallow repository
run: git fetch --unshallow origin ${{ steps.variables.outputs.src-branch }}

- name: Get last successful commit
id: last-successful-commit
uses: tylermilner/last-successful-commit-hash-action@v1
with:
workflow-id: 99826346
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: development # This has to be the main branch of repository since all workflows are run from there

- name: Get commit count
id: commit-count
shell: bash
run: |
echo "Deploying $(git rev-list --count ${{ steps.last-successful-commit.outputs.commit-hash }}..${{ github.sha }})) commits!"
echo "commit-count=$(git rev-list --count ${{ steps.last-successful-commit.outputs.commit-hash }}..${{ github.sha }})" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v3
with:
Expand All @@ -40,26 +64,26 @@ jobs:
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "store_path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
path: ${{ steps.pnpm-cache.outputs.store_path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache@v4
- uses: actions/cache/restore@v4
name: Setup Next.js cache
id: cache-nextjs-restore
with:
path: |
${{ github.workspace }}/src/build/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
key: ${{ runner.os }}-nextjs-${{ hashFiles('src/**/*.js', 'src/**/*.jsx', 'src/**/*.ts', 'src/**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-
${{ runner.os }}-nextjs-
- name: Install all dependencies
working-directory: ./src
Expand All @@ -73,15 +97,30 @@ jobs:
working-directory: ./src
run: pnpm build:cli

- uses: actions/cache/save@v4
name: Setup Next.js cache
id: cache-nextjs-save
with:
path: |
${{ github.workspace }}/src/build/cache
key: ${{ steps.cache-nextjs-restore.outputs.cache-primary-key }}

- name: Delete files not needed in deployment
working-directory: ./src
run: rm -rf __tests__ app pages components coverage data helpers hooks moonraker env recoil server utils zods test-setup.ts vitest.config.ts

- name: Push
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: v2.1.x-deployment # The branch name where you want to push the assets
FOLDER: "src" # The directory where your assets are generated
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token
MESSAGE: "Build: ({sha}) {msg}" # The commit message
run: rm -rf __tests__ app pages components coverage data helpers hooks moonraker env recoil server utils zods test-setup.ts vitest.config.mts tsconfig.vitest.json copy-files-from-to.json components.json postcss.config.js prettier.config.mjs tailwind.config.ts

- name: Rename src/ to app/
working-directory: ./
run: mv src app

- name: Publish to ${{ steps.variables.outputs.target-branch }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: .
commit-message: |
Deployed ${{ steps.commit-count.outputs.commit-count }} commit${{ steps.commit-count.outputs.commit-count > 1 && 's' || '' }}.
https://github.com/Rat-OS/RatOS-configurator/compare/${{ steps.last-successful-commit.outputs.commit-hash }}...${{ github.sha }}
git-config-name: Mikkel Schmidt
git-config-email: mikkel.schmidt@gmail.com
branch: ${{ steps.variables.outputs.target-branch }} # The branch name where you want to push the assets
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
},
"shellcheck.useWorkspaceRootAsCwd": true,
"prettier.useTabs": true,
"editor.detectIndentation": false
"editor.detectIndentation": false,
"python.REPL.enableREPLSmartSend": false
}
Loading

0 comments on commit 92c29b3

Please sign in to comment.