-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 2.12 KB
/
python-docker-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
49
50
51
52
53
54
55
56
57
58
59
# This workflow will first upload a Python Package using Twine
# It will then build and upload a Docker image
# These steps happen when a new tag is pushed
name: Python and Docker CI
on:
push:
tags:
- "*.*.*"
jobs:
python-package:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build --wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
docker-image:
needs: python-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set tag output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: wait for actoolkit
run: sleep 300
- name: Docker Setup Buildx
uses: docker/[email protected]
- name: Build and push the Docker images
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERIMAGE_TAG: ${{ steps.vars.outputs.tag }}
run: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker buildx build . --push --file dockerfiles/Dockerfile.minimal \
--tag netapp/astra-toolkits:latest-minimal --tag netapp/astra-toolkits:$DOCKERIMAGE_TAG-minimal \
--platform linux/amd64,linux/arm64
docker buildx build . --push --file dockerfiles/Dockerfile.minimal-unprivileged \
--tag netapp/astra-toolkits:latest-minimal-unprivileged --tag netapp/astra-toolkits:$DOCKERIMAGE_TAG-minimal-unprivileged \
--platform linux/amd64,linux/arm64
docker buildx build . --push --file dockerfiles/Dockerfile \
--tag netapp/astra-toolkits:latest --tag netapp/astra-toolkits:$DOCKERIMAGE_TAG \
--platform linux/amd64,linux/arm64