Skip to content

Commit 5c0a126

Browse files
Update CI actions using Docker script
When the config of the CI flow changes, we need to update the `notify-workflow-completed`, `run-workflow` and `upstream-builds-query` actions so that they would use the new config. This can be done separately for each action (steps are described in the action's READMEs). Alternatively, this can be done via the script I provide in this PR. The exact steps are described in the comments in the script.
1 parent 553c296 commit 5c0a126

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

actions/Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This Dockerfile can be used to quickly generate the needed artifacts when
2+
# updating `notify-workflow-completed`, `run-workflow` and `upstream-builds-query`
3+
# custom GH actions after changes in the `./config/config.json` file.
4+
# To update the artifacts:
5+
# 1. Push the modified `./config/config.json` to a feature branch.
6+
# 2. Provide the name of the feature branch to the `BRANCH_NAME` parameter below.
7+
# 3. Build the Docker image:
8+
# ```
9+
# docker build --tag actions .
10+
# ```
11+
# 4. Run the Docker image (the container will be created and will run for 5 min):
12+
# ```
13+
# docker run -it actions
14+
# ```
15+
# 5. List the Docker images and copy the container id:
16+
# ```
17+
# docker ps
18+
# ```
19+
# 6. Replace the container id in the following commands and run them from the root of the `ci` project:
20+
# ```
21+
# docker cp 66c205e35635:/workdir/ci/actions/notify-workflow-completed/dist/ ./notify-workflow-completed
22+
# docker cp 66c205e35635:/workdir/ci/actions/run-workflow/dist/ ./run-workflow
23+
# docker cp 66c205e35635:/workdir/ci/actions/upstream-builds-query/dist/ ./upstream-builds-query
24+
# ```
25+
# 7. Commit the changes in the actions to your feature branch.
26+
27+
FROM node:14-alpine3.13 AS build
28+
29+
ENV BRANCH_NAME=feature_branch_with_the_new_config
30+
31+
RUN apk add --update --no-cache \
32+
git \
33+
bash
34+
35+
WORKDIR /workdir
36+
37+
RUN git clone https://github.com/keep-network/ci -b $BRANCH_NAME
38+
39+
WORKDIR ci/actions/notify-workflow-completed
40+
RUN yarn install
41+
RUN yarn run prepare
42+
WORKDIR ../run-workflow
43+
RUN yarn install
44+
RUN yarn run prepare
45+
WORKDIR ../upstream-builds-query
46+
RUN yarn install
47+
RUN yarn run prepare
48+
49+
CMD sleep 300

0 commit comments

Comments
 (0)