diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 81f61dc..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: Python Scripts CI - -on: - schedule: - # Run on the 1st day of every month at 00:00 UTC - - cron: '0 0 1 * *' - push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - branches: - - 'claude/*' # Trigger on claude/* branch pushes for CI validation - - 'copilot/tag-release-v*' # Trigger release when Copilot creates a release branch - workflow_dispatch: # Allow manual trigger - inputs: - version: - description: 'Release version (e.g., v1.2.0). Leave empty for auto-generated version.' - required: false - type: string - release_name: - description: 'Custom release name. Leave empty for default.' - required: false - type: string - prerelease: - description: 'Mark as pre-release' - required: false - type: boolean - default: false - - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - # This is the version of the action for setting up Python, not the Python version. - uses: actions/setup-python@v4 - with: - # Semantic version range syntax or exact version of a Python version - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - # You can test your matrix by printing the current Python version - - name: Run Scrapers - run: python run_scrapers.py - - uses: actions/upload-artifact@v4 - with: - name: hop_database - path: | - data/hops.json - data/combined.json - release: - needs: build - runs-on: ubuntu-latest - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/copilot/tag-release-v') - steps: - - uses: actions/checkout@v4 - - - name: Generate version tag - id: version - run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.version }}" != "" ]]; then - # Use custom version from manual trigger - echo "tag_name=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT - if [[ "${{ github.event.inputs.release_name }}" != "" ]]; then - echo "release_name=${{ github.event.inputs.release_name }}" >> $GITHUB_OUTPUT - else - echo "release_name=Release ${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT - fi - elif [[ "${{ github.ref }}" == refs/heads/copilot/tag-release-v* ]]; then - # Extract version from Copilot release branch name: copilot/tag-release-vX.Y.Z -> vX.Y.Z - VERSION="${GITHUB_REF#refs/heads/copilot/tag-release-}" - echo "tag_name=$VERSION" >> $GITHUB_OUTPUT - echo "release_name=Release $VERSION" >> $GITHUB_OUTPUT - elif [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then - # Generate version based on current date (YYYY.MM format) - VERSION="v$(date +'%Y.%m')" - echo "tag_name=$VERSION" >> $GITHUB_OUTPUT - echo "release_name=Monthly Release $VERSION" >> $GITHUB_OUTPUT - else - # Use the pushed tag - echo "tag_name=${{ github.ref_name }}" >> $GITHUB_OUTPUT - echo "release_name=Release ${{ github.ref_name }}" >> $GITHUB_OUTPUT - fi - - - name: Create and push tag (for scheduled/dispatch/release-branch runs) - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/copilot/tag-release-v') - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git fetch origin main - # Only create and push the tag if it does not already exist - if git ls-remote --tags origin "${{ steps.version.outputs.tag_name }}" | grep -q .; then - echo "Tag ${{ steps.version.outputs.tag_name }} already exists, skipping tag creation." - else - git tag ${{ steps.version.outputs.tag_name }} $(git rev-parse origin/main) - git push origin ${{ steps.version.outputs.tag_name }} - fi - - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: hop_database - path: ./data - - - name: Create Release - id: create_release - uses: softprops/action-gh-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.version.outputs.tag_name }} - name: ${{ steps.version.outputs.release_name }} - draft: false - prerelease: ${{ github.event.inputs.prerelease == 'true' }} - files: ./data/combined.json \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c8a725c..3b50e48 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,10 +22,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 - + uses: actions/checkout@v6 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '18' cache: 'npm' @@ -42,10 +42,10 @@ jobs: npm run build:prod - name: Setup Pages - uses: actions/configure-pages@v4 - + uses: actions/configure-pages@v6 + - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: ./website/build @@ -59,4 +59,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5