-
Notifications
You must be signed in to change notification settings - Fork 88
61 lines (53 loc) · 2.29 KB
/
refreeze-dockerfile-requirements-txt.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
name: Refreeze Dockerfile.requirements.txt
on:
push:
paths:
- "**/Dockerfile"
- "**/Dockerfile.requirements.in"
- "**/Dockerfile.requirements.txt"
- ".github/workflows/refreeze-dockerfile-requirements-txt.yaml"
branches: ["main"]
workflow_dispatch:
jobs:
refreeze-dockerfile-requirements-txt:
name: Refreeze Dockerfile.requirements.txt
# Don't run this job on forks
if: github.repository == 'dask/dask-gateway'
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- image: dask-gateway
- image: dask-gateway-server
steps:
- uses: actions/checkout@v4
- name: Refreeze Dockerfile.requirements.txt based on Dockerfile.requirements.in
run: |
cd ${{ matrix.image }}
docker run --rm \
--env=CUSTOM_COMPILE_COMMAND='Use "Run workflow" button at https://github.com/dask/dask-gateway/actions/workflows/refreeze-dockerfile-requirements-txt.yaml' \
--volume=$PWD:/opt/${{ matrix.image }} \
--workdir=/opt/${{ matrix.image }} \
--user=root \
python:3.11-slim-bullseye \
sh -c 'pip install pip-tools==6.* && pip-compile --upgrade --output-file=Dockerfile.requirements.txt Dockerfile.requirements.in'
- name: git diff
run: git --no-pager diff --color=always
# ref: https://github.com/peter-evans/create-pull-request
- name: Create a PR
uses: peter-evans/create-pull-request@v6
with:
token: "${{ secrets.dask_bot_token }}"
author: Dask Bot Account <65357765+dask-bot@users.noreply.github.com>
committer: Dask Bot Account <65357765+dask-bot@users.noreply.github.com>
branch: update-image-${{ matrix.image }}
labels: dependencies
commit-message: Refreeze ${{ matrix.image}}/Dockerfile.requirements.txt
title: Refreeze ${{ matrix.image}}/Dockerfile.requirements.txt
body: >-
${{ matrix.image}}/Dockerfile.requirements.txt has been refrozen
based on ${{ matrix.image}}/Dockerfile.requirements.in.