dry-container/.github/workflows/sync_configs.yml

55 lines
1.8 KiB
YAML

# this file is managed by dry-rb/devtools project
name: sync_configs
on:
repository_dispatch:
jobs:
sync-configs:
runs-on: ubuntu-latest
if: github.event.action == 'sync_configs'
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: eregon/use-ruby-action@master
with:
ruby-version: 2.6
- name: Install latest bundler
run: gem install bundler
- name: Install dependencies
run: bundle install --jobs 4 --retry 3 --without tools test benchmarks docs
- name: Symlink ossy
run: ln -sf "$(bundle info ossy --path)/bin/ossy" bin/ossy
- name: Clone devtools
run: git clone https://github.com/dry-rb/devtools.git tmp/devtools
- name: Update configuration files from devtools
run: |
if [ -f ".github/workflows/custom_ci.yml" ]; then
rsync -arv --exclude '.github/workflows/ci.yml' tmp/devtools/shared/ . ;
else
rsync -arv tmp/devtools/shared/ . ;
fi
- name: Compile file templates
env:
GITHUB_LOGIN: dry-bot
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: |
if [ -f "project.yml" ]; then
for t in `ls tmp/devtools/templates`
do
bin/ossy t c tmp/devtools/templates/$t $(basename $t .erb) project.yml
done
fi
- name: Commit changes
run: |
rm bin/ossy
git config --local user.email "dry-bot@dry-rb.org"
git config --local user.name "dry-bot"
git add -A
git commit -m "[devtools] sync configs" || echo "nothing changed"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}