Skip to content

Commit bacc6d1

Browse files
authored
Merge pull request #60 from MITLibraries/temp-gha-fix
Fix Actions Deployment Errors
2 parents 8b83598 + fe1b1dd commit bacc6d1

3 files changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/dev-manual.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ jobs:
77
name: deploy-theme
88
runs-on: [self-hosted, linux, stage]
99
steps:
10-
- uses: actions/checkout@v3
10+
- name: setup-git
11+
run: |
12+
git config --global user.name "github-actions"
13+
git config --global user.email "github-actions@github.com"
14+
- name: clone-repo
15+
run: |
16+
git clone https://github.com/${{ github.repository }} repo
17+
cd repo
18+
git checkout ${{ github.sha }}
1119
- name: deploy-theme
1220
run: |
1321
chown -R :client .

.github/workflows/prod-deploy.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@ on:
55

66
jobs:
77
deploy-theme:
8+
if: github.ref == 'refs/heads/main'
89
name: deploy-theme
910
runs-on: [self-hosted, linux, prod]
1011
steps:
11-
- name: checkout code
12-
uses: actions/checkout@v3
13-
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 }}
1422
- name: deploy-theme
15-
if: github.ref == 'refs/heads/main'
1623
run: |
1724
chown -R :client .
1825
chmod -R g+w .

.github/workflows/stage-deploy.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ jobs:
1515
name: deploy-theme
1616
runs-on: [self-hosted, linux, stage]
1717
steps:
18-
- uses: actions/checkout@v3
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 }}
1927
- name: deploy-theme
2028
run: |
2129
chown -R :client .

0 commit comments

Comments
 (0)