Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
y-popov committed Aug 19, 2024
1 parent 6cd89b7 commit 245350b
Showing 1 changed file with 43 additions and 42 deletions.
85 changes: 43 additions & 42 deletions .github/workflows/build_docker_image.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# https://github.com/marketplace/actions/build-and-push-docker-images
name: Build, Test and Push Docker Image

# push:
# paths:
# - requirements.txt
# - Dockerfile

jobs:
base-image:
on:
push:
paths:
- requirements.txt
- Dockerfile
on: push
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand All @@ -25,40 +26,40 @@ jobs:
name: BaseImage
path: /tmp/base-image.tar

test-code:
on: push
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: BaseImage
path: /tmp
- name: Load image
run: |
docker load --input /tmp/base-image.tar
- name: Test code
run: |
docker run -v $(pwd):/code -w /code mercury/farmers-report-base:latest Rscript /code/tests/testthat.R
docker-image:
on:
pull_request:
branches:
- master
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image and push
uses: docker/build-push-action@v5
with:
tags: mercury/farmers-report:latest
# test-code:
# on: push
# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: BaseImage
# path: /tmp
# - name: Load image
# run: |
# docker load --input /tmp/base-image.tar
# - name: Test code
# run: |
# docker run -v $(pwd):/code -w /code mercury/farmers-report-base:latest Rscript /code/tests/testthat.R
#
# docker-image:
# on:
# pull_request:
# branches:
# - master
# if: github.event.pull_request.merged == true
# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build image and push
# uses: docker/build-push-action@v5
# with:
# tags: mercury/farmers-report:latest

0 comments on commit 245350b

Please sign in to comment.