UpdateDockerImages #743
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: UpdateDockerImages | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
prep-env: | |
runs-on: ubuntu-20.04 | |
name: Prepare environment | |
steps: | |
- uses: actions/checkout@v2 | |
- id: set-matrix | |
run: | | |
sudo apt-get install jq | |
sudo bash ./tests/scripts/cran/install_cran_repos.sh | |
echo "::set-output name=matrix::$(sudo bash ./tests/scripts/cran/get_R_releases.sh)" | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
push-docker-image: | |
needs: prep-env | |
name: Push docker image for R=${{ matrix.r-version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
r-version: ${{fromJson(needs.prep-env.outputs.matrix)}} | |
runs-on: ubuntu-20.04 | |
environment: publish | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build new Docker image | |
run: bash "tests/scripts/execute_docker_test_env.sh" "${{ matrix.r-version }}" no_tests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker login | |
run: echo "$SECRET_DOCKER_TOKEN" | docker login --username "$SECRET_DOCKER_USER_NAME" --password-stdin | |
env: # Set the secret as an input | |
SECRET_DOCKER_USER_NAME: ${{ secrets.DOCKER_USER_NAME }} | |
SECRET_DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} | |
- name: Push new Docker images | |
run: "bash tests/scripts/check_push_docker_image.sh ${{ matrix.r-version }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |