From c2df152d8f91c6f56fc6a358a1dc7ae4fefedc7f Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 26 Jul 2023 19:19:41 +0200 Subject: [PATCH] use the shared filenames action to check filenames --- .github/workflows/build-and-deploy.yml.orig | 83 --------------------- .github/workflows/check.yml | 63 ---------------- .github/workflows/filenames.yaml | 11 +++ 3 files changed, 11 insertions(+), 146 deletions(-) delete mode 100644 .github/workflows/build-and-deploy.yml.orig delete mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/filenames.yaml diff --git a/.github/workflows/build-and-deploy.yml.orig b/.github/workflows/build-and-deploy.yml.orig deleted file mode 100644 index 59b3fd6..0000000 --- a/.github/workflows/build-and-deploy.yml.orig +++ /dev/null @@ -1,83 +0,0 @@ -name: Build and Deploy -on: - push: - branches: [main] - pull_request: - branches: [main] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true - -env: - REGEX_INCLUDE: "\\.(pdf|link|txt|png|md)$" - -jobs: - build: - runs-on: ubuntu-latest - name: Build pdfs out of tex,md and various doc files - container: - image: ghcr.io/csunibo/build-image:latest - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - - name: Recursively compile tex files - run: rec "\.tex$" "xelatex -pdf" - - - name: Recursively compile (doc|ppt)x? files - run: rec "\.(doc|ppt)x?$" "libreoffice --headless --convert-to pdf --outdir ." - - # - name: Recursively compile md files - # run: rec "\.md$" /usr/bin/md2pdf - - - name: Recursively compile xopp files - run: rec "\.xopp$" /usr/bin/xopp2pdf - - - name: Generate static directory listing - run: statik -page /usr/share/page.gohtml -l -b "https://${{ github.event.repository.owner.name }}.github.io/${{ github.event.repository.name }}/" -i "$REGEX_INCLUDE" site - - - name: Generate site artifact - if: github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v3 - with: - name: build - path: ./site - - deploy: - name: Deploy to Github Pages - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - - needs: build - - if: github.ref == 'refs/heads/main' - steps: - - name: Download static site artifact - uses: actions/download-artifact@v3 - with: - name: build - path: site - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: site - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 0e35cc3..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Lint file names -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - check: - name: Check file names - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./appunti - with: - path: "./appunti" - pattern: '^(\.gitkeep|([a-z0-9]+(-[a-z0-9]+)*\.[a-zA-Z]+))$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./dispense - with: - path: "./dispense" - pattern: '^(\.gitkeep|(\d+(-[a-z0-9]+)+\.[a-zA-Z]+))$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./esercizi - with: - path: "./esercizi" - pattern: '^(\.gitkeep|([a-z0-9]+(-[a-z0-9]+)*\.[a-zA-Z]+))$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./lavagne - with: - path: "./lavagne" - pattern: '^(\.gitkeep|(\d{4}-\d{2}-\d{2}(-[a-z0-9]+)+\.[a-zA-Z]+))$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./libri - with: - path: "./libri" - pattern: '^(\.gitkeep|([a-z0-9]+(-[a-z0-9]+)*\.[a-zA-Z]+))$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./lucidi - with: - path: "./lucidi" - pattern: '^(\.gitkeep|(\d+(-[a-z0-9]+)+\.[a-zA-Z]+))$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./prove - with: - path: "./prove" - pattern: '^(\.gitkeep)|((scritto|totale|parziale\d|orale(\d?)|progetto(\d?))-\d{4}(-\d{2}-\d{2})?(-[a-z0-9]+)?-(testo|soluzione)(-[a-z0-9]+)?\.[a-zA-Z0-9]+)$' - recursive: "true" - - uses: csunibo/lint-filenames@v1.3.2 - name: Lint file names under ./varie - with: - path: "./varie" - pattern: '^(\.gitkeep|([a-z0-9]+(-[a-z0-9]+)*\.[a-zA-Z]+))$' - recursive: "true" diff --git a/.github/workflows/filenames.yaml b/.github/workflows/filenames.yaml new file mode 100644 index 0000000..785198f --- /dev/null +++ b/.github/workflows/filenames.yaml @@ -0,0 +1,11 @@ +name: Check filenames +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + filenames: + name: Check filenames + uses: csunibo/config/.github/workflows/filenames.yml@main