-
Notifications
You must be signed in to change notification settings - Fork 70
79 lines (79 loc) · 1.99 KB
/
ci.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
75
76
77
78
79
name: CI
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
platform:
- ballerina
- buildpack
- elixir
- go
- java
- lua
- nodejs
- perl
- php
- python
- ruby
- scratch
- static
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: run tests
run: make test platform=${{ matrix.platform }}
shell: bash
publish:
if: github.repository == 'tsuru/platforms' && github.event_name != 'pull_request'
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- ballerina
- buildpack
- elixir
- go
- java
- lua
- nodejs
- perl
- php
- python
- ruby
- scratch
- static
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- run: |
ref="${GITHUB_REF##*/}"
img="tsuru/${{ matrix.platform }}"
tags="${img}:${ref}"
if [[ ${ref} == "master" ]] || [[ ${ref} == "main" ]]; then
tags="${img}:latest"
elif [[ ${ref} =~ ${{ matrix.platform }}-([0-9.]+) ]]; then
tags=${img}:${BASH_REMATCH[1]},${img}:latest
fi
echo "::set-output name=tag::${tags}"
if: github.event_name != 'pull_request'
id: tags
shell: bash
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
if: github.event_name != 'pull_request' && steps.tags.outputs.tag != ''
with:
context: ./${{ matrix.platform }}
push: true
tags: ${{ steps.tags.outputs.tag }}
platforms: linux/amd64