-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (81 loc) · 2.42 KB
/
drone-fpm.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: container - drone-fpm
on:
push:
branches: [ main ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
paths:
- .github/workflows/drone-fpm.yaml
- drone-fpm/**
pull_request:
branches: [ main ]
paths:
- .github/workflows/drone-fpm.yaml
- drone-fpm/**
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: divialth/drone-fpm
# renovate: datasource=rubygems depName=fpm versioning=ruby
FPM_VERSION: 1.15.1
jobs:
build-app:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout drone-fpm repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
repository: betterengineering/drone-fpm
- name: Prepare Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Install dependencies
run: gem install --no-document fpm -v ${{ env.FPM_VERSION }}
- name: build entrypoint generator
run: make build
- name: generate entrypoint
run: ./out/generate-entrypoint
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: entrypoint
path: out/entrypoint.sh
build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- build-app
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: download artifacts
uses: actions/download-artifact@v4
with:
name: entrypoint
path: drone-fpm
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: drone-fpm
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}