61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
name: sync
|
|
run-name:
|
|
on:
|
|
schedule:
|
|
- cron: '0 4 * * *'
|
|
issues:
|
|
types: [opened]
|
|
jobs:
|
|
build:
|
|
runs-on: steam-runner
|
|
steps:
|
|
- name: Clone repository
|
|
run: |
|
|
ls -lh
|
|
rm -rf az-vnr-patch
|
|
git -c http.sslVerify=false clone https://${{ secrets.GITHUB_TOKEN }}@${{ secrets.URI }}/${{ github.repository }}.git
|
|
- name: sync currect file
|
|
run: |
|
|
cd /home/steam/steamcmd
|
|
ls -lh
|
|
./steamcmd.sh +login ${{ secrets.STEAM_USERNAME }} ${{ secrets.STEAM_PASSWORD }} +workshop_download_item 394360 3115864680 +quit
|
|
- name: clean src and copy to src
|
|
run: |
|
|
ls -lh
|
|
cd az-vnr-patch
|
|
git checkout pure-az
|
|
cp -r src ../
|
|
git checkout main
|
|
rm -rf src
|
|
ls -lh
|
|
mv ../src ./
|
|
cp /home/steam/Steam/steamapps/workshop/content/394360/3115864680/descriptor.mod src/descriptor.mod
|
|
- name: rebuild src
|
|
run: |
|
|
curl -X 'GET' -O https://${{ secrets.URI }}/azurlane-hoi4/vnr/releases/download/Diff/archive.zip -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}'
|
|
unzip archive.zip
|
|
cp -r src/* az-vnr-patch/src/
|
|
rm -rf src
|
|
rm archive.zip
|
|
- name: check diff
|
|
id: check_changes
|
|
run: |
|
|
ls -lh
|
|
cd az-vnr-patch
|
|
ls -lh
|
|
if [ -z "$(git status --porcelain)" ]; then
|
|
echo "::set-output name=has_changes::false"
|
|
else
|
|
echo "::set-output name=has_changes::true"
|
|
fi
|
|
- name: commit and push
|
|
if: ${{ steps.check_changes.outputs.has_changes == 'true' }}
|
|
run: |
|
|
ls -lh
|
|
cd az-vnr-patch
|
|
ls -lh
|
|
git config --local user.email "actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "actions[bot]"
|
|
git add .
|
|
git commit --allow-empty -m "$(date '+%Y-%m-%d %H:%M:%S')"
|
|
git -c http.sslVerify=false push https://${{ secrets.GITHUB_TOKEN }}@${{ secrets.URI }}/${{ github.repository }}.git |