Skip to content

Commit 284a32b

Browse files
committed
wip docker build & update actions
1 parent ab0a9fb commit 284a32b

1 file changed

Lines changed: 50 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414

1515
- name: Set up Node.js
16-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
16+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1717
with:
1818
node-version: '18.x'
1919

2020
- name: Install datadog-ci
21-
run: npm install -g @datadog/datadog-ci
21+
run: |
22+
ddci_release="_$(uname -s | tr A-Z a-z)-$(uname -m | sed -e 's/^x86_64$/x64/' -e 's/^aarch64$/arm64/')"
23+
gh release download --repo datadog/datadog-ci --pattern "*$ddci_release*" --clobber -O /usr/local/bin/datadog-ci
24+
chmod +x /usr/local/bin/datadog-ci
25+
env:
26+
GH_TOKEN: ${{ github.token }}
2227

2328
- name: Set up Python
24-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
29+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2530
with:
2631
python-version: '3.x'
2732

2833
- name: Set up Go
29-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
34+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3035
with:
3136
go-version-file: go.mod
3237

@@ -42,7 +47,19 @@ jobs:
4247
run: go mod tidy
4348

4449
- name: Install gotestsum
45-
run: go install gotest.tools/gotestsum@latest
50+
run: |
51+
gotestsum_release="_$(uname -s | tr A-Z a-z)_$(uname -m | sed -e 's/^x86_64$/amd64/' -e 's/^aarch64$/arm64/')"
52+
gh release download --repo gotestyourself/gotestsum --pattern "*$gotestsum_release*" --clobber -O /tmp/gotestsum.tar.gz
53+
gh release download --repo gotestyourself/gotestsum --pattern "*-checksums.txt*" --clobber -O /tmp/gotestsum_checksums.txt
54+
if [[ "$(sha256sum /tmp/gotestsum.tar.gz | cut -d ' ' -f 1)" != "$(grep -F "$gotestsum_release" /tmp/gotestsum_checksums.txt | cut -d ' ' -f 1)" ]]; then
55+
echo "Checksum mismatch for gotestsum"
56+
exit 1
57+
fi
58+
tar -xzf /tmp/gotestsum.tar.gz -C /usr/local/bin gotestsum
59+
chmod +x /usr/local/bin/gotestsum
60+
env:
61+
GH_TOKEN: ${{ github.token }}
62+
4663

4764
- name: Run tests with gotestsum
4865
run: |
@@ -73,7 +90,7 @@ jobs:
7390
runs-on: ubuntu-latest
7491
steps:
7592
- name: Checkout
76-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
93+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7794
- name: Find LaunchDarkly feature flags in diff
7895
uses: ./ # Uses an action in the root directory
7996
id: find-flags
@@ -118,10 +135,10 @@ jobs:
118135
runs-on: ubuntu-latest
119136
steps:
120137
- name: Checkout
121-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
138+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
122139

123140
- name: Set up Python
124-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
141+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
125142
with:
126143
python-version: '3.x'
127144

@@ -131,7 +148,7 @@ jobs:
131148
pip install pre-commit
132149
133150
- name: Set up Node.js
134-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
151+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
135152
with:
136153
node-version: '18.8.0'
137154

@@ -140,4 +157,26 @@ jobs:
140157

141158
- name: Run pre-commit for GitHub Actions Docs
142159
run: pre-commit run -a github-action-docs
143-
160+
161+
build-image:
162+
needs: [go-test, e2e-tests, generate-docs]
163+
runs-on: ubuntu-latest
164+
permissions:
165+
contents: read
166+
packages: write
167+
steps:
168+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
169+
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
170+
- name: Set up QEMU
171+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
172+
- name: Docker Bake Action
173+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
174+
with:
175+
cache-from: type=gha
176+
cache-to: type=gha,mode=max
177+
context: .
178+
file: ./Dockerfile
179+
tags: |
180+
ghcr.io/launchdarkly/find-code-references-in-pull-request:latest
181+
ghcr.io/launchdarkly/find-code-references-in-pull-request:${{ github.sha }}
182+
push: ${{ github.ref == 'refs/heads/main' }}

0 commit comments

Comments
 (0)