fix: new workflow
This commit is contained in:
@@ -14,14 +14,24 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./Projects/kompose
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Sync Respository
|
||||
with:
|
||||
path: home
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: valknarogg/kompose
|
||||
path: kompose
|
||||
- name: Commit and push changes (if any)
|
||||
shell: bash
|
||||
env:
|
||||
CI_COMMIT_MESSAGE: "repo: update kompose"
|
||||
CI_COMMIT_AUTHOR: "technitz[bot]@valknar/kompose
|
||||
CI_COMMIT_EMAIL: admin@pivoine.art
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
ssh-keyscan host.docker.internal --port=2222 >> ~/.ssh/known_hosts
|
||||
${{ github.workspace }}/.init/bin/mirror_project.sh $SYNC_TARGET '${{ github.event.head_commit.message }}' ${{ runner.temp }}/kompose
|
||||
cd kompose
|
||||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
|
||||
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
|
||||
|
||||
${{ github.workspace }}/.init/bin/mirror_project.sh '${{ github.event.head_commit.message }}' ../home
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
TMP_PROJECT="$3"
|
||||
TMP_PROJECT="$PWD"
|
||||
RELATIVE_HOME="$TMP_PROJECT"
|
||||
CURRENT_PROJECT="${s##*/}"
|
||||
|
||||
git config --global user.email "valknar@pivoine.art"
|
||||
git config --global user.name "Sebastian Krüger"
|
||||
|
||||
mkdir "$TMP_PROJECT"
|
||||
git clone "$1" "$TMP_PROJECT"
|
||||
cp -rf ./* "$TMP_PROJECT"
|
||||
cd "$TMP_PROJECT"
|
||||
rm -rf ./.env **/uploads/ ./**/*.sql ./**/*.pem
|
||||
git add -A
|
||||
git commit -m "$2"
|
||||
git push
|
||||
cd -
|
||||
if [[ `git status --porcelain --untracked-files=no` ]]; then
|
||||
# Changes
|
||||
cp -rf $RELATIVE_HOME/Projects/kompose/* $TMP_PROJECT
|
||||
rm -rf $TMP_PROJECT/.env $TMP_PROJECT/**/uploads/ $TMP_PROJECT/**/*.sql $TMP_PROJECT/**/*.pem
|
||||
git add -A
|
||||
git commit -m "$1"
|
||||
git push
|
||||
else
|
||||
# No changes
|
||||
echo "no changes to latest posts"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user