|
| 1 | +name: Build generic Actors |
| 2 | +description: Build generic Actors and push them to Apify |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + web-scraper: |
| 8 | + description: apify/web-scraper |
| 9 | + type: boolean |
| 10 | + required: false |
| 11 | + default: true |
| 12 | + cheerio-scraper: |
| 13 | + description: apify/cheerio-scraper |
| 14 | + type: boolean |
| 15 | + required: false |
| 16 | + default: true |
| 17 | + playwright-scraper: |
| 18 | + description: apify/playwright-scraper |
| 19 | + type: boolean |
| 20 | + required: false |
| 21 | + default: true |
| 22 | + puppeteer-scraper: |
| 23 | + description: apify/puppeteer-scraper |
| 24 | + type: boolean |
| 25 | + required: false |
| 26 | + default: true |
| 27 | + jsdom-scraper: |
| 28 | + description: apify/jsdom-scraper |
| 29 | + type: boolean |
| 30 | + required: false |
| 31 | + default: true |
| 32 | + camoufox-scraper: |
| 33 | + description: apify/camoufox-scraper |
| 34 | + type: boolean |
| 35 | + required: false |
| 36 | + default: true |
| 37 | + build-channel: |
| 38 | + description: Build channel |
| 39 | + type: choice |
| 40 | + required: true |
| 41 | + options: |
| 42 | + - stable |
| 43 | + - development |
| 44 | + - custom |
| 45 | + default: stable |
| 46 | + version: |
| 47 | + description: Custom version (only for custom build channel) |
| 48 | + type: string |
| 49 | + required: false |
| 50 | + build-tag: |
| 51 | + description: Custom build tag (only for custom build channel) |
| 52 | + type: string |
| 53 | + required: false |
| 54 | + |
| 55 | +jobs: |
| 56 | + push-to-apify: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + settings: |
| 62 | + - actor: web-scraper |
| 63 | + stable-version: 3.0 |
| 64 | + stable-build-tag: version-3 |
| 65 | + development-version: 0.0 |
| 66 | + development-build-tag: development |
| 67 | + should-build: ${{ github.event.inputs.web-scraper }} |
| 68 | + - actor: cheerio-scraper |
| 69 | + stable-version: 3.0 |
| 70 | + stable-build-tag: version-3 |
| 71 | + development-version: 0.0 |
| 72 | + development-build-tag: development |
| 73 | + should-build: ${{ github.event.inputs.cheerio-scraper }} |
| 74 | + - actor: playwright-scraper |
| 75 | + stable-version: 1.0 |
| 76 | + stable-build-tag: version-1 |
| 77 | + development-version: 0.0 |
| 78 | + development-build-tag: development |
| 79 | + should-build: ${{ github.event.inputs.playwright-scraper }} |
| 80 | + - actor: puppeteer-scraper |
| 81 | + stable-version: 3.0 |
| 82 | + stable-build-tag: version-3 |
| 83 | + development-version: 0.0 |
| 84 | + development-build-tag: development |
| 85 | + should-build: ${{ github.event.inputs.puppeteer-scraper }} |
| 86 | + - actor: jsdom-scraper |
| 87 | + stable-version: 0.1 |
| 88 | + stable-build-tag: latest |
| 89 | + development-version: 0.0 |
| 90 | + development-build-tag: development |
| 91 | + should-build: ${{ github.event.inputs.jsdom-scraper }} |
| 92 | + - actor: camoufox-scraper |
| 93 | + stable-version: 3.0 |
| 94 | + stable-build-tag: version-3 |
| 95 | + development-version: 0.0 |
| 96 | + development-build-tag: development |
| 97 | + should-build: ${{ github.event.inputs.camoufox-scraper }} |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v4 |
| 100 | + |
| 101 | + - name: Log matrix |
| 102 | + run: | |
| 103 | + echo "Actor: ${{ matrix.settings.actor }}" |
| 104 | + echo "Should build: ${{ matrix.settings.should-build }}" |
| 105 | +
|
| 106 | + - name: Calculate versions and tags |
| 107 | + id: calculate-versions |
| 108 | + if: matrix.settings.should-build == 'true' |
| 109 | + run: | |
| 110 | + if [ "${{ github.event.inputs.build-channel }}" = "stable" ]; then |
| 111 | + echo "version=${{ matrix.settings.stable-version }}\n" >> $GITHUB_ENV |
| 112 | + echo "build-tag=${{ matrix.settings.stable-build-tag }}\n" >> $GITHUB_ENV |
| 113 | + elif [ "${{ github.event.inputs.build-channel }}" = "development" ]; then |
| 114 | + echo "version=${{ matrix.settings.development-version }}\n" >> $GITHUB_ENV |
| 115 | + echo "build-tag=${{ matrix.settings.development-build-tag }}\n" >> $GITHUB_ENV |
| 116 | + else |
| 117 | + echo "version=${{ github.event.inputs.version }}\n" >> $GITHUB_ENV |
| 118 | + echo "build-tag=${{ github.event.inputs.build-tag }}\n" >> $GITHUB_ENV |
| 119 | + fi |
| 120 | +
|
| 121 | + - name: Build ${{ matrix.settings.actor }} |
| 122 | + uses: apify/push-actor-action@master |
| 123 | + if: matrix.settings.should-build == 'true' |
| 124 | + with: |
| 125 | + token: ${{ secrets.APIFY_ACTOR_BUILD_TOKEN }} |
| 126 | + build-tag: ${{ steps.calculate-versions.outputs.build-tag }} |
| 127 | + version: ${{ steps.calculate-versions.outputs.version }} |
| 128 | + working-directory: packages/actor-scraper/${{ matrix.settings.actor }} |
0 commit comments