-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.28 KB
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Sync
on:
schedule:
- cron: "0 15 * * *" # 00:00 JST everyday (15:00 UTC)
jobs:
sync:
name: Sync feeds
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KONOE_SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KONOE_KNOWN_HOSTS }}
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: registry.camph.net
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Check out
uses: actions/checkout@v2
- name: Build feeds.json
run: |
docker pull registry.camph.net/feeds:latest
docker run --rm -v $PWD/feeds.toml:/apps/feeds.toml:ro -v $PWD/dist:/apps/dist registry.camph.net/feeds:latest
- name: rsync feeds.json
run: rsync $PWD/dist/feeds.json -e "ssh -p ${{ secrets.KONOE_SSH_PORT }}" ${{ secrets.KONOE_SSH_USERNAME }}@${{ secrets.KONOE_SSH_HOST }}:/home/deploy/feeds/www/public/feeds.json
- name: Notify to Slack
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()