Skip to content

Commit

Permalink
build: Adding retry action
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Mar 13, 2023
1 parent d74d9bf commit 62717b0
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ jobs:
pip install -r requirements.txt
- name: Build Base Image
run: |
.bin/build-base.sh
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 10
command: |
.bin/build-base.sh
- name: Save Base Image
run: |
Expand Down Expand Up @@ -71,24 +76,34 @@ jobs:
name: base-image
path: /tmp

- name: Load Base Image
run: |
docker load --input /tmp/base-image.tar
- name: Load Base Image)
uses: nick-fields/retry@v2
with:
max_attempts: 2
retry_on: error
timeout_minutes: 5
command: |
docker load --input /tmp/base-image.tar
- name: Build Image(s)
run: |
source ./.bin/_bash.inc
export image=${{matrix.image}}
prepareImage "${currentDir}/docker/${image}"
for entry in ${currentDir}/docker/${image}/*.pkr.hcl;
do
buildImage "${currentDir}/docker/${image}" "$entry"
imageName=$(cat "$entry" | grep 'repository' | cut -d'"' -f2)
fileName=$(echo "$imageName" | cut -d'/' -f2 | cut -d'-' -f1)
mkdir -p /tmp/docker-images/
docker save -o /tmp/docker-images/$fileName-image.tar $imageName
done
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 15
command: |
source ./.bin/_bash.inc
export image=${{matrix.image}}
prepareImage "${currentDir}/docker/${image}"
for entry in ${currentDir}/docker/${image}/*.pkr.hcl;
do
buildImage "${currentDir}/docker/${image}" "$entry"
imageName=$(cat "$entry" | grep 'repository' | cut -d'"' -f2)
fileName=$(echo "$imageName" | cut -d'/' -f2 | cut -d'-' -f1)
mkdir -p /tmp/docker-images/
docker save -o /tmp/docker-images/$fileName-image.tar $imageName
done
- name: Upload Image(s)
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 62717b0

Please sign in to comment.