-
-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (51 loc) · 1.8 KB
/
publish.yml
File metadata and controls
55 lines (51 loc) · 1.8 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: publish
on:
push:
branches:
- coatl
paths:
- requirements/**
- Dockerfile
- entrypoint.sh
jobs:
tagger:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tags.outputs.version }}
major_minor: ${{ steps.tags.outputs.major_minor }}
major: ${{ steps.tags.outputs.major }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Extract version number
id: tags
run: |
# Extract the Python version from the Dockerfile
VERSION=$(grep -oP 'devpi-server==\K[0-9]+\.[0-9]+\.[0-9]+' requirements/devpi.txt)
echo "VERSION=${VERSION}"
# Trim the version to the first two segments (major.minor)
MAJOR_MINOR=$(echo "$VERSION" | grep -oP '[0-9]+\.[0-9]+')
echo "MAJOR_MINOR=${MAJOR_MINOR}"
# Trim the version to the first segment (major)
MAJOR=$(echo "$MAJOR_MINOR" | grep -oP '^[0-9]+')
echo "MAJOR=${MAJOR}"
# Export the extracted version to GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major_minor=${MAJOR_MINOR}" >> $GITHUB_OUTPUT
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
build:
needs: tagger
uses: coatl-dev/workflows/.github/workflows/docker-build-push-multi-registry.yml@v6
with:
dockerhub-repo: coatldev/devpi
dockerhub-username: ${{ vars.DOCKERHUB_USERNAME }}
quay-repo: quay.io/coatldev/devpi
quay-username: ${{ vars.QUAY_USERNAME }}
metadata-tags: |
${{ needs.tagger.outputs.version }}
${{ needs.tagger.outputs.major_minor }}
${{ needs.tagger.outputs.major }}
latest-tag-flavor: 'true'
secrets:
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}
quay-password: ${{ secrets.QUAY_ROBOT_TOKEN }}