diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6e5060f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + +jobs: + lint: + name: Lint Jinja Templates + runs-on: ubuntu-latest + steps: + - name: Checkout git repo + uses: actions/checkout@v4 + + - name: Run j2lint + uses: ansible-actions/j2lint-action@v0.0.1 + with: + target: "*.j2" + + sync: + name: Netbox Sync + runs-on: ubuntu-latest + if: github.ref_name == 'main' + needs: lint + env: + DATA_SOURCE_ID: "1" + steps: + - run: | + curl https://netbox.freifunk-duesseldorf.de/api/core/data-sources/${DATA_SOURCE_ID}/sync/ \ + -X POST --fail \ + -H "Authorization: Token ${{ secrets.NETBOX_API_TOKEN }}" diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml deleted file mode 100644 index b39884d..0000000 --- a/.github/workflows/sync.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Netbox Sync -on: - push: - branches: [main] - -jobs: - trigger: - name: Trigger - runs-on: ubuntu-latest - env: - DATA_SOURCE_ID: "1" - steps: - - run: | - curl https://netbox.freifunk-duesseldorf.de/api/core/data-sources/${DATA_SOURCE_ID}/sync/ \ - -X POST --fail \ - -H "Authorization: Token ${{ secrets.NETBOX_API_TOKEN }}"