mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-19 22:24:17 +01:00
fix CI deployment
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -6,6 +6,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "master"
|
- "master"
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ref:
|
||||||
|
type: "string"
|
||||||
|
required: true
|
||||||
|
description: "The ref (branch or tag) to build"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|||||||
42
.github/workflows/deploy1.yml
vendored
Normal file
42
.github/workflows/deploy1.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
update-versions:
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
steps:
|
||||||
|
- uses: "actions/checkout@v4"
|
||||||
|
- run: "echo 'CLEAN_VERSION=${{ github.ref }}' | sed 's,refs/tags/v,,g' >> $GITHUB_ENV"
|
||||||
|
# Write the new version to package.json
|
||||||
|
- uses: "actions/setup-node@v4"
|
||||||
|
- run: "yarn version --new-version $CLEAN_VERSION --no-git-tag-version"
|
||||||
|
# Write the new version to pyproject.toml
|
||||||
|
- run: "pipx install poetry"
|
||||||
|
- uses: "actions/setup-python@v5"
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
cache: "poetry"
|
||||||
|
- run: "poetry version $CLEAN_VERSION"
|
||||||
|
# Commit the changes and move the tag!
|
||||||
|
- run: |
|
||||||
|
git config --global user.email "yeicor@users.noreply.github.com"
|
||||||
|
git config --global user.name "Yeicor"
|
||||||
|
if git commit -am "Automatically update version to $CLEAN_VERSION"; then
|
||||||
|
git push
|
||||||
|
# Move the tag to the new commit
|
||||||
|
git tag -f -a "$VERSION" -m "$VERSION"
|
||||||
|
git push -f --tags # Force push the tag to GitHub
|
||||||
|
# The tag move will NOT trigger a new workflow
|
||||||
|
else
|
||||||
|
echo "No source change detected on version update (did you repeat a release tag??)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rebuild: # Makes sure all artifacts are updated and use the new version for the next deployment steps
|
||||||
|
needs: "update-versions"
|
||||||
|
uses: "./.github/workflows/deploy2.yml"
|
||||||
|
with:
|
||||||
|
ref: "master" # Ensure we are cloning the latest version of the repository
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
on:
|
on:
|
||||||
push:
|
workflow_call:
|
||||||
tags:
|
inputs:
|
||||||
- "v**"
|
ref:
|
||||||
|
type: "string"
|
||||||
|
required: true
|
||||||
|
description: "The ref (branch or tag) to build"
|
||||||
|
|
||||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||||
permissions:
|
permissions:
|
||||||
@@ -17,25 +20,11 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
update-versions:
|
|
||||||
runs-on: "ubuntu-latest"
|
|
||||||
steps:
|
|
||||||
- uses: "actions/checkout@v4"
|
|
||||||
- run: "echo 'CLEAN_VERSION=${{ github.ref }}' | sed 's,refs/tags/v,,g' >> $GITHUB_ENV"
|
|
||||||
# Write the new version to package.json
|
|
||||||
- uses: "actions/setup-node@v4"
|
|
||||||
- run: "yarn version --new-version $CLEAN_VERSION"
|
|
||||||
# Write the new version to pyproject.toml
|
|
||||||
- run: "pipx install poetry"
|
|
||||||
- uses: "actions/setup-python@v5"
|
|
||||||
with:
|
|
||||||
python-version: "3.11"
|
|
||||||
cache: "poetry"
|
|
||||||
- run: "poetry version $CLEAN_VERSION"
|
|
||||||
|
|
||||||
rebuild: # Makes sure all artifacts are updated and use the new version
|
rebuild: # Makes sure all artifacts are updated and use the new version
|
||||||
needs: "update-versions"
|
needs: "update-versions"
|
||||||
uses: "./.github/workflows/build.yml"
|
uses: "./.github/workflows/build.yml"
|
||||||
|
with:
|
||||||
|
ref: "${{ inputs.ref }}"
|
||||||
|
|
||||||
deploy-frontend:
|
deploy-frontend:
|
||||||
needs: "rebuild"
|
needs: "rebuild"
|
||||||
@@ -81,6 +70,8 @@ jobs:
|
|||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
ref: "${{ inputs.ref }}"
|
||||||
- uses: "JRubics/poetry-publish@v2"
|
- uses: "JRubics/poetry-publish@v2"
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
Reference in New Issue
Block a user