playwright/.github/workflows/publish_canary_docker.yml
Andrey Lushnikov ef5c87ccea
devops: switch docker publishing to a bash script (#3704)
It turns out Github Actions have docker pre-installed.

This patch unifies the codepaths that we use to build docker image
locally and to publish it from CI.

As a result, there's no extra `--prepare-context` argument in
`//docs/docker/build.sh` that was used solely on CI.

References #2926
2020-09-01 11:33:19 -07:00

37 lines
981 B
YAML

name: "devrelease"
on:
push:
branches:
- master
- release-*
paths:
- docs/docker/**
- browsers.json
jobs:
publish-canary-docker:
name: "publish to DockerHub"
runs-on: ubuntu-18.04
if: github.repository == 'microsoft/playwright'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10.15
- run: npm ci
- run: npm run build
- name: login & publish to docker
run: |
# login to docker
docker login --username playwright --password ${{ secrets.DOCKER_PASSWORD }} playwright.azurecr.io
# build docker image
./docs/docker/build.sh
# tag image accordingly
docker tag playwright:localbuild public/playwright:next
docker tag playwright:localbuild public/playwright:sha-$(git rev-parse HEAD)
docker rmi playwright:localbuild
# push image to registry
docker push public/playwright:next