-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create workflow file for image build exp
- Loading branch information
1 parent
d36f3a7
commit bd83f65
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
on: | ||
push: | ||
branches: | ||
- update_docker_exp | ||
|
||
|
||
name: Test Docker Image Build Remote | ||
|
||
jobs: | ||
deploy: | ||
name: Docker Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: HopkinsIDD/cholera-mapping-pipeline | ||
ref: ${{ github.ref }} | ||
lfs: true | ||
- name: Checkout LFS objects | ||
run: git lfs checkout | ||
- name: Check that lfs files are present | ||
run: wc -l renv.cache/R/renv/cache/v5/R-4.2/x86_64-pc-linux-gnu/abind/1.4-5/4f57884290cc75ab22f4af9e9d4ca862/abind/DESCRIPTION | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
Username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Generate Tags | ||
id: tags | ||
env: | ||
IMAGE_TAG_RUN: ${{ github.run_number }} | ||
IMAGE_TAG_REF: ${{ github.ref }} | ||
run: | | ||
echo "::set-output name=shashort::$(git log -1 --pretty=%h)" | ||
echo "::set-output name=reftag::${IMAGE_TAG_REF##*/}-r$IMAGE_TAG_RUN" | ||
- name: Build Push Master | ||
uses: docker/build-push-action@v2 | ||
if: contains( github.ref, 'master') || contains( github.base_ref, 'master' ) | ||
with: | ||
push: false | ||
tags: | | ||
hopkinsidd/choleramappingpipeline:latest | ||
hopkinsidd/choleramappingpipeline:latest-master | ||
hopkinsidd/choleramappingpipeline:${{steps.tags.outputs.shashort}} | ||
hopkinsidd/choleramappingpipeline:${{steps.tags.outputs.reftag}} | ||
hopkinsidd/choleramappingpipeline:${{ github.sha }} | ||
- name: Build Push Master | ||
uses: docker/build-push-action@v3 | ||
if: (contains( github.ref, 'update_docker') || contains( github.base_ref, 'update_docker' )) | ||
with: | ||
context: . | ||
push: false | ||
tags: | | ||
hopkinsidd/choleramappingpipeline:latest-dev | ||
hopkinsidd/choleramappingpipeline:${{steps.tags.outputs.shashort}} | ||
hopkinsidd/choleramappingpipeline:${{steps.tags.outputs.reftag}} | ||
hopkinsidd/choleramappingpipeline:${{ github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
- name: Log Build Information | ||
if: failure() | ||
run: | | ||
du -sh /tmp | ||
du -sh /home/app | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
rm -rf /tmp/.buildx-cache-new |