Skip to content
73 changes: 60 additions & 13 deletions .github/workflows/release-generic-actors.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build generic Actors

on:
push:
branches:
- chore/automatic-actor-build
workflow_dispatch:
inputs:
web-scraper:
Expand Down Expand Up @@ -33,16 +36,22 @@ on:
type: boolean
required: false
default: true
build-channel:
description: Build channel
type: choice
required: true
options:
- stable
- development
- custom
version:
description: Version to build
description: Custom version (only for custom build channel)
type: string
required: true
default: '3.0'
required: false
build-tag:
description: Build tag
description: Custom build tag (only for custom build channel)
type: string
required: true
default: version-3
required: false

jobs:
push-to-apify:
Expand All @@ -52,25 +61,63 @@ jobs:
matrix:
settings:
- actor: web-scraper
stable-version: 3.0
stable-build-tag: version-3
development-version: 0.0
development-build-tag: development
should-build: ${{ github.event.inputs.web-scraper }}
- actor: cheerio-scraper
stable-version: 3.0
stable-build-tag: version-3
development-version: 0.0
development-build-tag: development
should-build: ${{ github.event.inputs.cheerio-scraper }}
- actor: playwright-scraper
stable-version: 1.0
stable-build-tag: version-1
development-version: 0.0
development-build-tag: development
should-build: ${{ github.event.inputs.playwright-scraper }}
- actor: puppeteer-scraper
stable-version: 3.0
stable-build-tag: version-3
development-version: 0.0
development-build-tag: development
should-build: ${{ github.event.inputs.puppeteer-scraper }}
- actor: jsdom-scraper
stable-version: 0.1
stable-build-tag: latest
development-version: 0.0
development-build-tag: development
should-build: ${{ github.event.inputs.jsdom-scraper }}
- actor: camoufox-scraper
stable-version: 3.0
stable-build-tag: version-3
development-version: 0.0
development-build-tag: development
should-build: ${{ github.event.inputs.camoufox-scraper }}
steps:
- uses: actions/checkout@v4

- name: Build ${{ matrix.settings.actor }}
uses: apify/push-actor-action@master
- name: Calculate versions and tags
id: calculate-versions
if: matrix.settings.should-build == 'true'
with:
token: ${{ secrets.APIFY_ACTOR_BUILD_TOKEN }}
build-tag: ${{ github.event.inputs.build-tag }}
version: ${{ github.event.inputs.version }}
working-directory: packages/actor-scraper/${{ matrix.settings.actor }}
run: |
if [ "${{ github.event.inputs.build-channel }}" == "stable" ]; then
echo "version=${{ matrix.settings.stable-version }}\n" >> $GITHUB_ENV
echo "build-tag=${{ matrix.settings.stable-build-tag }}\n" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.build-channel }}" == "development" ]; then
echo "version=${{ matrix.settings.development-version }}\n" >> $GITHUB_ENV
echo "build-tag=${{ matrix.settings.development-build-tag }}\n" >> $GITHUB_ENV
else
echo "version=${{ github.event.inputs.version }}\n" >> $GITHUB_ENV
echo "build-tag=${{ github.event.inputs.build-tag }}\n" >> $GITHUB_ENV
fi

- name: Build ${{ matrix.settings.actor }}
run: |
echo "Building ${{ matrix.settings.actor }}!"
echo "Channel: ${{ github.event.inputs.build-channel }}"
echo "Version: ${{ steps.calculate-versions.outputs.version }}"
echo "Build tag: ${{ steps.calculate-versions.outputs.build-tag }}"
echo "Working directory: packages/actor-scraper/${{ matrix.settings.actor }}"
Loading