-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (70 loc) · 2.38 KB
/
cicd.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
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
name: "CI/CD"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ "published" ]
schedule:
- cron: '0 0 * * *'
jobs:
ruby:
strategy:
fail-fast: false
matrix:
flavor: [bullseye, bookworm]
ruby_version: ["3.1.2"]
name: Ruby ${{ matrix.ruby_version }} on Debian ${{ matrix.flavor }}
runs-on: ubuntu-22.04
concurrency:
group: "docker_${{ matrix.ruby_version }}_${{ matrix.flavor }}_${{ github.event_name == 'pull_request' && format('pr_{0}', github.event.number) || format('ref_{0}', github.ref) }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate imagedate.txt
run: make imagedate.txt
- name: Set Docker Metadata
id: docker_metadata
uses: docker/[email protected]
with:
images: |
ghcr.io/lutriseng/ruby-base/${{ matrix.ruby_version }}/${{ matrix.flavor }}
tags: |
type=schedule
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.description=Lutris's base image for Ruby ${{ matrix.ruby_version }} on Debian ${{ matrix.flavor }}
- name: Build and Push Docker Image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
FLAVOR=${{ matrix.flavor }}
RUBY_VERSION=${{ matrix.ruby_version }}