Update r-docker-deploy.yaml #2
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
name: Build R Docker Image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Build Docker image | |
- name: Build Docker image | |
run: | | |
docker build -t ghcr.io/dfe-analytical-services/dfe-r-base:latest . | |
# Run R setup action inside Docker container | |
- name: Run R setup action | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
# Commit the changes to the Docker image | |
- name: Commit Docker image changes | |
run: | | |
docker commit $(docker ps -l -q) ghcr.io/dfe-analytical-services/dfe-r-base:latest | |
# Push Docker image to DockerHub | |
- name: Push Docker image to DockerHub | |
run: | | |
docker push ghcr.io/dfe-analytical-services/dfe-r-base:latest |