-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (63 loc) · 2.05 KB
/
build-squeeze.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build w/ Squeeze (R 2.13.0 - R 2.15.3)
on:
workflow_dispatch:
inputs:
inpwhichcont:
description: 'Which R versions to build, defaults to "all".'
required: false
default: 'all'
type: string
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.setup-matrix.outputs.containers }}
steps:
- uses: actions/checkout@v3
- name: Set up matrix of containers
id: setup-matrix
run: |
inp="${{ github.event.inputs.inpwhichcont }}"
if [ "x$inp" == "xall" -o "x$inp" == "x" ]; then
out="$(cat containers/squeeze-versions.txt | tr '\n' ',' | sed 's/,$//')"
else
out=$inp
fi
cnt="$(echo '["'$out'"]' | tr -d ' ' | sed 's/,/","/g')"
echo "containers=$cnt" >> $GITHUB_OUTPUT
containers:
needs: setup-matrix
strategy:
fail-fast: false
matrix:
container: ${{ fromJson(needs.setup-matrix.outputs.containers) }}
runs-on: ubuntu-latest
name: R ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
platforms: linux/i386
context: "{{defaultContext}}:containers"
file: Dockerfile-squeeze
build-args: |
R_VERSION=${{ matrix.container }}
push: true
provenance: false
tags: ghcr.io/r-hub/evercran/${{ matrix.container }},rhub/evercran:${{ matrix.container}},docker.io/rhub/evercran:${{ matrix.container }}