devops: move Docker build to playwright-internal (#9023)

This commit is contained in:
Max Schmitt 2021-10-07 23:42:44 +02:00 committed by GitHub
parent a892fe6db0
commit 0713cb3d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 68 deletions

View File

@ -1,41 +0,0 @@
name: "devrelease:docker"
on:
workflow_dispatch:
push:
branches:
- master
- release-*
paths:
- utils/docker/**
- browsers.json
- .github/workflows/publish_canary_docker.yml
- src/nativeDeps.ts
jobs:
publish-canary-docker:
name: "publish to DockerHub"
runs-on: ubuntu-20.04
if: github.repository == 'microsoft/playwright'
steps:
- uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: playwright.azurecr.io
username: playwright
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
- run: npm run build
- run: node lib/cli/cli install-deps
- run: ./utils/docker/build.sh bionic playwright:localbuild-bionic
- run: ./utils/docker/build.sh focal playwright:localbuild-focal
- name: tag & publish
run: |
./utils/docker/tag_and_push.sh playwright:localbuild-bionic playwright.azurecr.io/public/playwright:next-bionic
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:next
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:sha-${{ github.sha }}
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:next-focal

View File

@ -42,34 +42,14 @@ jobs:
AZ_ACCOUNT_KEY: ${{ secrets.AZ_ACCOUNT_KEY }}
AZ_ACCOUNT_NAME: ${{ secrets.AZ_ACCOUNT_NAME }}
publish-docker-release:
trigger-docker-build:
name: "publish to DockerHub"
runs-on: ubuntu-20.04
if: github.repository == 'microsoft/playwright'
steps:
- uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: playwright.azurecr.io
username: playwright
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
- run: npm run build
- run: node lib/cli/cli install-deps
- run: ./utils/docker/build.sh bionic playwright:localbuild-bionic
- run: ./utils/docker/build.sh focal playwright:localbuild-focal
- name: tag & publish
run: |
# GITHUB_REF has a form of `refs/tags/v1.3.0`.
# TAG_NAME would be `v1.3.0`
TAG_NAME=${GITHUB_REF#refs/tags/}
./utils/docker/tag_and_push.sh playwright:localbuild-bionic playwright.azurecr.io/public/playwright:bionic
./utils/docker/tag_and_push.sh playwright:localbuild-bionic playwright.azurecr.io/public/playwright:${TAG_NAME}-bionic
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:latest
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:focal
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:${TAG_NAME}
./utils/docker/tag_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright:${TAG_NAME}-focal
- 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_production\", \"client_payload\": {\"ref\": \"${{ github.sha }}\"}}" \
https://api.github.com/repos/microsoft/playwright-internal/dispatches

View File

@ -0,0 +1,26 @@
name: "devrelease:docker"
on:
workflow_dispatch:
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