Skip to content

Commit 7cbce9e

Browse files
committed
WIP: Replacing actions/checkout Functionality
Why these changes are being introduced: The hosts running the GitHub actions are running Amazon Linux 2 which is no longer on the supported host OS list for self-hosted GitHub runners. Since the actions-runner on the hosts is configured to auto-update, it not longer has node16 embedded and node20 cannot run on AL2 (because the host OS does not have an up-to-date-enough version of the glibc library). The only thing in the workflow that requires node20 is the actions/checkout command. So, instead of using actions/checkout, we just run the very short list of git commands that we need to checkout the correct commit to run the simple deploy command. We update the manual workflow, the staging workflow (for pushes to the main branch) and the production workflow (for tagged releases on the main branch). How this addresses that need: * Remove the actions/checkout@v3 step in all three workflows * Create new steps for the necessary git commands to clone the repo and checkout the correct commit Side effects of this change: None. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1327
1 parent 26b7060 commit 7cbce9e

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/prod-deploy.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ jobs:
99
name: deploy-theme
1010
runs-on: [self-hosted, linux, prod]
1111
steps:
12-
- name: checkout code
13-
uses: actions/checkout@v3
14-
12+
- name: setup-git
13+
run: |
14+
git config --global user.name "github-actions"
15+
git config --global user.email "github-actions@github.com"
16+
- name: clone-repo
17+
run: |
18+
git clone https://github.com/${{ github.repository }} repo
19+
cd repo
20+
git fetch --tags
21+
git checkout tags/${{ github.event.release.tag_name }}
1522
- name: deploy-theme
1623
run: |
1724
chown -R :client .

.github/workflows/stage-deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ jobs:
1515
name: deploy-theme
1616
runs-on: [self-hosted, linux, stage]
1717
steps:
18+
- name: setup-git
19+
run: |
20+
git config --global user.name "github-actions"
21+
git config --global user.email "github-actions@github.com"
22+
- name: clone-repo
23+
run: |
24+
git clone https://github.com/${{ github.repository }} repo
25+
cd repo
26+
git checkout ${{ github.ref_name }}
1827
- name: deploy-theme
1928
run: |
20-
cd "$GITHUB_WORKSPACE"
21-
git clone "https://github.com/$GITHUB_REPOSITORY.git" .
22-
git checkout "$GITHUB_SHA"
2329
chown -R :client .
2430
chmod -R g+w .
2531
make deploy

0 commit comments

Comments
 (0)