Skip to content

Commit 1abf8c9

Browse files
authored
Start triggering Docker image builds on release (#81)
Since we're about to release 1.0.0, we should start including it in our base images. This will start calling the `repository_dispatch` event in https://github.com/apify/apify-actor-docker/blob/master/.github/workflows/release-python.yml#L13-L14 (and other Python image workflows), and that will start building the images. There's also an [accompanying PR](apify/apify-actor-docker#93) in `apify-actor-docker`, which has to be merged first. I've also simplified the workflow a bit and rewrote it to not use third-party actions, so that we're not that vulnerable to supply chain attacks, especially since we're passing PATs with high permissions to the actions.
1 parent 056945f commit 1abf8c9

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -118,31 +118,18 @@ jobs:
118118
119119
- # Upload the build artifacts to the release
120120
name: Upload the build artifacts to release
121-
uses: svenstaro/upload-release-action@v2
122121
if: github.event_name == 'release'
123-
with:
124-
repo_token: ${{ secrets.GITHUB_TOKEN }}
125-
file: dist/*
126-
file_glob: true
127-
tag: ${{ github.ref }}
128-
129-
- # Get the current package version for use in Docker images
130-
name: Parse package version for Docker images
131-
id: get-package-version
132-
run: |
133-
package_version=`python ./scripts/print_current_package_version.py`
134-
echo "package_version=$package_version" >> $GITHUB_OUTPUT
135-
136-
# - # Trigger building the docker images in apify/apify-actor-docker repo
137-
# name: Trigger Docker Image Build
138-
# uses: peter-evans/repository-dispatch@v2
139-
# if: steps.get-release-type.outputs.docker_image_tag != ''
140-
# with:
141-
# token: ${{ secrets.TRIGGER_DOCKER_IMAGE_BUILD_TOKEN }}
142-
# repository: apify/apify-actor-docker
143-
# event-type: build-python-images
144-
# client-payload: >
145-
# {
146-
# "release_tag": "${{ steps.get-release-type.outputs.docker_image_tag }}",
147-
# "apify_sdk_version": "${{ steps.get-package-version.outputs.package_version }}"
148-
# }
122+
run: gh release upload ${{ github.ref_name }} dist/*
123+
env:
124+
GH_TOKEN: ${{ github.token }}
125+
126+
- # Trigger building the Python Docker images in apify/apify-actor-docker repo
127+
name: Trigger Docker image build
128+
run: |
129+
PACKAGE_VERSION=`python ./scripts/print_current_package_version.py`
130+
gh api -X POST "/repos/apify/apify-actor-docker/dispatches" \
131+
-F event_type=build-python-images \
132+
-F client_payload[release_tag]=${{ steps.get-release-type.outputs.docker_image_tag }} \
133+
-F client_payload[apify_version]=$PACKAGE_VERSION
134+
env:
135+
GH_TOKEN: ${{ secrets.BUILD_DOCKER_IMAGES_REPOSITORY_DISPATCH_GH_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Changelog
44
[1.0.0](../../releases/tag/v1.0.0) - Upcoming
55
---------------------------------------------
66

7+
### Internal changes
8+
9+
- started triggering base Docker image builds when releasing a new version
10+
711
[0.2.0](../../releases/tag/v0.2.0) - 2023-03-06
812
-----------------------------------------------
913

0 commit comments

Comments
 (0)