-
-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (47 loc) · 1.71 KB
/
ci.yml
File metadata and controls
55 lines (47 loc) · 1.71 KB
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
name: CI
on: [push]
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version: [3.0.0, 3.0.1, 3.0.2, 3.0.3]
node_version: [16.13.0, 16.13.1]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build local image
uses: docker/build-push-action@v2
with:
load: true
build-args: |
RUBY_VERSION=${{ matrix.ruby_version }}
NODE_VERSION=${{ matrix.node_version }}
tags: ruby-node-alpine:${{ matrix.ruby_version }}-${{ matrix.node_version }}-alpine
- name: Test image
run: |
docker run -i ruby-node-alpine:${{ matrix.ruby_version }}-${{ matrix.node_version }}-alpine \
/bin/sh -c "ruby --version && node --version && yarn --version"
- name: Login to DockerHub
uses: docker/login-action@v1
env:
token: ${{ secrets.DOCKERHUB_TOKEN }}
if: "${{ env.token != '' }}"
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & push for all platforms
uses: docker/build-push-action@v2
env:
token: ${{ secrets.DOCKERHUB_TOKEN }}
with:
push: "${{ env.token != '' }}"
build-args: |
RUBY_VERSION=${{ matrix.ruby_version }}
NODE_VERSION=${{ matrix.node_version }}
platforms: linux/arm/v6,linux/arm64,linux/arm/v7,linux/ppc64le,linux/amd64
tags: thisismydesign/ruby-node-alpine:${{ matrix.ruby_version }}-${{ matrix.node_version }}-alpine