github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/.github/workflows/docker-update.yml (about)

     1  name: Update Docker image
     2  on:
     3    push:
     4      # Rebuild the image when Dockerfile is changed. This is safe on a PR
     5      # branch, too -- the automatically built Docker image will be tagged with
     6      # the branch name instead of "latest".
     7      paths:
     8        - 'Dockerfile'
     9        - '.github/workflows/docker-update.yml'
    10    schedule:
    11      # Rebuild the image weekly.
    12      - cron: '0 0 * * 0'
    13  jobs:
    14    build-and-push:
    15      # Forks and dependabot cannot access secrets so the job would fail.
    16      # Run for non dependabot PRs or regular pushes to web-platform-tests/wpt.fyi
    17      if: |
    18        (github.repository == 'web-platform-tests/wpt.fyi' && github.actor != 'dependabot[bot]') &&
    19        ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'web-platform-tests/wpt.fyi') ||
    20        (github.event_name != 'pull_request'))
    21      runs-on: ubuntu-latest
    22      steps:
    23        - uses: actions/checkout@v3
    24        - uses: elgohr/Publish-Docker-Github-Action@v5
    25          # https://github.com/elgohr/Publish-Docker-Github-Action
    26          with:
    27            name: webplatformtests/wpt.fyi
    28            username: ${{ secrets.DOCKER_USERNAME }}
    29            password: ${{ secrets.DOCKER_TOKEN }}
    30            dockerfile: Dockerfile
    31            snapshot: true