Update Docker image #396
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Docker image | |
on: | |
push: | |
# Rebuild the image when Dockerfile is changed. This is safe on a PR | |
# branch, too -- the automatically built Docker image will be tagged with | |
# the branch name instead of "latest". | |
paths: | |
- 'Dockerfile' | |
- '.github/workflows/docker-update.yml' | |
schedule: | |
# Rebuild the image weekly. | |
- cron: '0 0 * * 0' | |
jobs: | |
build-and-push: | |
# Forks and dependabot cannot access secrets so the job would fail. | |
# Run for non dependabot PRs or regular pushes to web-platform-tests/wpt.fyi | |
if: | | |
(github.repository == 'web-platform-tests/wpt.fyi' && github.actor != 'dependabot[bot]') && | |
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'web-platform-tests/wpt.fyi') || | |
(github.event_name != 'pull_request')) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: elgohr/Publish-Docker-Github-Action@v5 | |
# https://github.com/elgohr/Publish-Docker-Github-Action | |
with: | |
name: webplatformtests/wpt.fyi | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
dockerfile: Dockerfile | |
snapshot: true |