-
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.44 KB
/
publish.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
name: publish
on:
push:
branches:
- 'coatl'
paths:
- '.github/workflows/publish.yml'
- 'Dockerfile'
schedule:
- cron: '0 20 * * 2,6'
jobs:
semver:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tags.outputs.version }}
major_minor: ${{ steps.tags.outputs.major_minor }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version number
id: tags
run: |
# Extract the Python version from the Dockerfile
VERSION=$(grep 'ENV PYTHON3_VERSION' Dockerfile | cut -d '=' -f 2)
echo "VERSION=${VERSION}"
# Trim the version to the first two segments (major.minor)
MAJOR_MINOR=$(echo $VERSION | cut -d'.' -f1-2)
echo "MAJOR_MINOR=${MAJOR_MINOR}"
# Export the extracted version to GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major_minor=${MAJOR_MINOR}" >> $GITHUB_OUTPUT
publish:
needs: semver
uses: coatl-dev/workflows/.github/workflows/docker-publish-multi-platform.yml@v4
with:
registry-image: coatldev/six
metadata-tags: |
type=raw,value=${{ needs.semver.outputs.version }}
type=raw,value=${{ needs.semver.outputs.major_minor }}
type=raw,value=latest,enable={{is_default_branch}}
dockerhub-username: ${{ vars.DOCKERHUB_USERNAME }}
secrets:
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}