Skip to content

Commit 088086f

Browse files
committed
Update GitHub Actions workflow to deploy ConnectorAPI artifacts and clean existing version folder
1 parent 8cbc9db commit 088086f

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/work-jar.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,34 @@ jobs:
4646
GROUP_ID: fr.sandro642.github
4747
ARTIFACT_ID: ConnectorAPI
4848
VERSION: ${{ steps.extract_version.outputs.version }}
49-
- name: Deploy to GitHub Pages
50-
uses: JamesIves/github-pages-deploy-action@v4
49+
- name: Checkout target repository
50+
uses: actions/checkout@v4
5151
with:
52+
repository: sandro642/sandro642.github.io
5253
token: ${{ secrets.GH_TOKEN }}
53-
repository-name: sandro642/sandro642.github.io
54-
branch: main
55-
folder: build/repo
56-
target-folder: connectorapi/jar
54+
path: target-repo
55+
- name: Clean existing version folder
56+
run: |
57+
if [ -d "target-repo/connectorapi/jar" ]; then
58+
echo "Cleaning existing connectorapi/jar folder..."
59+
rm -rf target-repo/connectorapi/jar
60+
fi
61+
mkdir -p target-repo/connectorapi/jar
62+
- name: Copy new artifacts
63+
run: |
64+
cp -r build/repo/* target-repo/connectorapi/jar/
65+
- name: Deploy to GitHub Pages
66+
run: |
67+
cd target-repo
68+
git config --local user.email "action@github.com"
69+
git config --local user.name "GitHub Action"
70+
git add .
71+
if git diff --staged --quiet; then
72+
echo "No changes to commit"
73+
else
74+
git commit -m "Update ConnectorAPI artifacts for version ${{ steps.extract_version.outputs.version }}"
75+
git push
76+
fi
5777
- name: Create and push Git tag (with override)
5878
run: |
5979
git config --local user.email "action@github.com"

0 commit comments

Comments
 (0)