devops: trigger docker publishing as part of NPM publishing (#9964)

This way we can tag docker image with a matching NPM version.
This commit is contained in:
Andrey Lushnikov 2021-11-02 03:01:49 -07:00 committed by GitHub
parent 9b57f0ceb5
commit d91d58cbec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 32 deletions

View File

@ -1,4 +1,4 @@
name: "devrelease:npm"
name: "publish canary"
on:
workflow_dispatch:
@ -9,8 +9,8 @@ on:
- release-*
jobs:
publish-canary-npm:
name: "publish to NPM"
publish-canary:
name: "publish canary NPM & Trigger canary Docker"
runs-on: ubuntu-20.04
if: github.repository == 'microsoft/playwright'
steps:
@ -44,4 +44,12 @@ jobs:
utils/publish_all_packages.sh --beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
# Trigger canary docker build and tag it with NPM canary version
VERSION=$(node -e 'console.log(require("./package.json").version)')
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}" \
--data "{\"event_type\": \"build_docker_canary\", \"client_payload\": {\"ref\": \"${{ github.sha }}\", \"package_version\": \"${VERSION}\"}}" \
https://api.github.com/repos/microsoft/playwright-internal/dispatches

View File

@ -1,4 +1,4 @@
name: "release"
name: "publish release"
on:
release:

View File

@ -1,28 +0,0 @@
name: "devrelease:docker"
on:
workflow_dispatch:
schedule:
- cron: "10 0 * * *"
push:
branches:
- master
- release-*
paths:
- utils/docker/**
- browsers.json
- .github/workflows/trigger_canary_docker.yml
- src/nativeDeps.ts
jobs:
trigger-docker-canary:
name: "Trigger Docker build"
runs-on: ubuntu-20.04
if: github.repository == 'microsoft/playwright'
steps:
- run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}" \
--data "{\"event_type\": \"build_docker_canary\", \"client_payload\": {\"ref\": \"${{ github.sha }}\"}}" \
https://api.github.com/repos/microsoft/playwright-internal/dispatches