-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (66 loc) · 2.26 KB
/
Copy pathrelease.yml
File metadata and controls
75 lines (66 loc) · 2.26 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
packages: write
jobs:
publish-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# The torch wheel + intermediate buildx layers exceed the default 14 GB
# of free disk on ubuntu-latest. Free up ~30 GB by removing preinstalled
# SDKs we don't need (Android, .NET, Haskell, etc.).
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Lowercase image name
id: image
run: echo "name=ghcr.io/${REPO,,}" >> "$GITHUB_OUTPUT"
env:
REPO: ${{ github.repository }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute image tags
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ steps.image.outputs.name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
labels: |
org.opencontainers.image.title=privacy-filter
org.opencontainers.image.description=Stateless FastAPI microservice that detects PII in plain text
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ github.ref_name }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: mode=max
sbom: true