Skip to content

Commit aadcbbb

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 aadcbbb

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

actions/Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 by executing the following command from the
8+
# `./actions` folder:
9+
# ```
10+
# docker build --tag actions .
11+
# ```
12+
# 4. Run the built Docker image (the container will run in the background and
13+
# will update the code of the actions):
14+
# ```
15+
# docker run -d actions
16+
# ```
17+
# 5. Within 5 min list the run Docker conteiners and copy the container id:
18+
# ```
19+
# docker ps
20+
# ```
21+
# 6. Replace the container id in the below commands and run them from the
22+
# the `./actions` folder. The commands will copy the updated `dist` folders
23+
# from the container filesystem to your local code.
24+
# ```
25+
# docker cp 66c205e35635:/workdir/ci/actions/notify-workflow-completed/dist/ ./notify-workflow-completed
26+
# docker cp 66c205e35635:/workdir/ci/actions/run-workflow/dist/ ./run-workflow
27+
# docker cp 66c205e35635:/workdir/ci/actions/upstream-builds-query/dist/ ./upstream-builds-query
28+
# ```
29+
# 7. Commit & push the changes in the actions to your feature branch.
30+
31+
FROM node:14-alpine3.13 AS build
32+
33+
ENV BRANCH_NAME=feature_branch_with_the_new_config
34+
35+
RUN apk add --update --no-cache \
36+
git \
37+
bash
38+
39+
WORKDIR /workdir
40+
41+
RUN git clone https://github.com/keep-network/ci -b $BRANCH_NAME
42+
43+
WORKDIR ci/actions/notify-workflow-completed
44+
RUN yarn install
45+
RUN yarn run prepare
46+
WORKDIR ../run-workflow
47+
RUN yarn install
48+
RUN yarn run prepare
49+
WORKDIR ../upstream-builds-query
50+
RUN yarn install
51+
RUN yarn run prepare
52+
53+
CMD sleep 300

0 commit comments

Comments
 (0)