Skip to content

worker

worker #2441

Workflow file for this run

on:
workflow_dispatch:
schedule:
- cron: '13 */6 * * *'
name: worker
env:
REGISTRY: ghcr.io
IMAGE_NAME: flexicon/tft-suggester/worker
jobs:
build_image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@5138f76647652447004da686b2411557eaf65f33
name: Setup buildx
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
scrape_champions:
uses: ./.github/workflows/run_scraper.yml
needs: build_image
secrets: inherit
with:
scraper: scrape_champions
image_name: ghcr.io/flexicon/tft-suggester/worker
scrape_comps:
uses: ./.github/workflows/run_scraper.yml
needs: build_image
secrets: inherit
with:
scraper: scrape_comps
image_name: ghcr.io/flexicon/tft-suggester/worker
scrape_items:
uses: ./.github/workflows/run_scraper.yml
needs: build_image
secrets: inherit
with:
scraper: scrape_items
image_name: ghcr.io/flexicon/tft-suggester/worker
trigger_webhook:
runs-on: ubuntu-latest
needs:
- scrape_champions
- scrape_comps
- scrape_items
steps:
- name: curl
run: |
curl -X POST ${{ secrets.DATA_FETCHED_WEBHOOK }}
cleanup:
runs-on: ubuntu-latest
needs:
- scrape_champions
- scrape_comps
- scrape_items
steps:
- uses: actions/delete-package-versions@0635864898b476b1b4ba530fc7854286f20b360c
with:
package-name: 'tft-suggester/worker'
package-type: 'container'
min-versions-to-keep: 5
delete-only-untagged-versions: 'true'