@sean-krail Regarding the speed of upload/download of artifacts
Uploading 62MB takes 25 seconds and Downloading 62MB takes 3 seconds.
Uploading 348MB takes 2m15s and Downloading 348MB takes 16 seconds.
I’ve tried using gzip, but the image size was reduced to 345MB so it’s negligible and might be significant for larger images.
Given the fact that uploading (push) is done once and downloading (pull) is done multiple times, I’m quite happy with the speed.
Even if it takes 5 minutes to upload your image, it’ll take 30 seconds to download the image (more or less). I assume that a 1GB image takes more than 30 seconds to build (when there’s no cache), hence it’s better to use upload/download.
My conclusion - use upload/download artifacts, here’s how I did it in
test.yml
on: [push]
jobs:
docker_build:
runs-on: ubuntu-latest
name: Docker Build
steps:
- uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: Build Image
env:
DOCKER_ORG: unfor19
DOCKER_REPO: install-aws-cli-action
DOCKER_TAG: ${{ env.GITHUB_REF_SLUG }}
run: |
export DOCKER_FULLTAG="${DOCKER_ORG}/${DOCKER_REPO}:${DOCKER_TAG//\\//-}"
docker build -t "$DOCKER_FULLTAG" .
mkdir -p path/to/artifacts
docker save "$DOCKER_FULLTAG" > path/to/artifacts/docker-image.tar
echo "$DOCKER_FULLTAG" > path/to/artifacts/docker-tag
- uses: actions/upload-artifact@v2
with:
name: docker-artifact
path: path/to/artifacts
test_latest_version_v1:
needs: docker_build
runs-on: ubuntu-latest
name: latest v1
env:
AWS_CLI_VERSION: 1
steps:
- name: Download Docker Image (Artifact)
uses: actions/download-artifact@v2
with:
name: docker-artifact
path: path/to/artifacts
- name: Run test in Docker
run: |
cd path/to/artifacts
docker load < docker-image.tar
export DOCKER_FULLTAG=$(cat docker-tag)
docker run --rm "$DOCKER_FULLTAG" $AWS_CLI_VERSION
- uses: actions/checkout@v2
- name: Run test on Runner
run: |
sudo ./entrypoint.sh