Skip to content

Commit

Permalink
Update CI actions using Docker script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
michalinacienciala committed Mar 10, 2023
1 parent 553c296 commit 5c0a126
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions actions/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This Dockerfile can be used to quickly generate the needed artifacts when
# updating `notify-workflow-completed`, `run-workflow` and `upstream-builds-query`
# custom GH actions after changes in the `./config/config.json` file.
# To update the artifacts:
# 1. Push the modified `./config/config.json` to a feature branch.
# 2. Provide the name of the feature branch to the `BRANCH_NAME` parameter below.
# 3. Build the Docker image:
# ```
# docker build --tag actions .
# ```
# 4. Run the Docker image (the container will be created and will run for 5 min):
# ```
# docker run -it actions
# ```
# 5. List the Docker images and copy the container id:
# ```
# docker ps
# ```
# 6. Replace the container id in the following commands and run them from the root of the `ci` project:
# ```
# docker cp 66c205e35635:/workdir/ci/actions/notify-workflow-completed/dist/ ./notify-workflow-completed
# docker cp 66c205e35635:/workdir/ci/actions/run-workflow/dist/ ./run-workflow
# docker cp 66c205e35635:/workdir/ci/actions/upstream-builds-query/dist/ ./upstream-builds-query
# ```
# 7. Commit the changes in the actions to your feature branch.

FROM node:14-alpine3.13 AS build

ENV BRANCH_NAME=feature_branch_with_the_new_config

RUN apk add --update --no-cache \
git \
bash

WORKDIR /workdir

RUN git clone https://github.com/keep-network/ci -b $BRANCH_NAME

WORKDIR ci/actions/notify-workflow-completed
RUN yarn install
RUN yarn run prepare
WORKDIR ../run-workflow
RUN yarn install
RUN yarn run prepare
WORKDIR ../upstream-builds-query
RUN yarn install
RUN yarn run prepare

CMD sleep 300

0 comments on commit 5c0a126

Please sign in to comment.