-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (42 loc) · 1.46 KB
/
update_docker_images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: UpdateDockerImages
on:
schedule:
- cron: '0 0 * * *'
push:
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 }}