Skip to content

Commit

Permalink
Hopefully made the CI functional
Browse files Browse the repository at this point in the history
  • Loading branch information
T145 committed Feb 13, 2024
1 parent 8aa3662 commit ddb33ee
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 34 deletions.
65 changes: 31 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
name: CI

on: push
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install deps
run: python3 -m pip install -r tools/requirements.txt --no-warn-script-location
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:

- name: Build
run: |
mkdir built
python3 tools/build.py filters/main.yml --hosts built/hosts.txt --abp built/abp.txt --domains built/domains.txt
brotli built/*
permissions: read-all

- name: Ensure files have contents
run: |
[ $(wc -l < built/hosts.txt) -gt 100 ]
[ $(wc -l < built/abp.txt) -gt 100 ]
[ $(wc -l < built/domains.txt) -gt 100 ]
- name: Publish
if: github.ref == 'refs/heads/master'
run: |
mkdir -p ~/.ssh/
echo "|1|40RGWMsg0FNOPYd+x4ZLEosg4zQ=|EAyRl4G9+69a9dq0SUQpWimmpNk= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+v6Lr/30gISPJk8ViZ/esm/PYi97Bqxhr5Fn9Yt1kI" >~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
echo "${{ secrets.SSH_KEY }}" >~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
sftp [email protected] <<'EOF'
lcd built
cd orcapet/notonmyshift
put *
EOF
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install deps
run: python3 -m pip install -r tools/requirements.txt --no-warn-script-location
- name: Build
run: |
mkdir built
python3 tools/build.py filters/main.yml --hosts built/hosts.txt --abp built/abp.txt --domains built/domains.txt
brotli built/*
- name: Ensure files have contents
run: |
[ $(wc -l < built/hosts.txt) -gt 100 ]
[ $(wc -l < built/abp.txt) -gt 100 ]
[ $(wc -l < built/domains.txt) -gt 100 ]
- name: Publish
if: github.ref == 'refs/heads/master'
run: |
git config --global --add safe.directory /__w/not-on-my-shift/not-on-my-shift
chmod +x commit.bash
bash commit.bash
0 one-click-build.sh → build.bash
100755 → 100644
File renamed without changes.
0 commit.sh → commit.bash
100755 → 100644
File renamed without changes.

0 comments on commit ddb33ee

Please sign in to comment.