-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.28 KB
/
python.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
name: python
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'python/*'
- '.github/workflows/python.yml'
workflow_dispatch:
env:
REGISTRY_PATH: 'docker.io/paritytech'
IMAGE_NAME: 'python'
PYTHON_VERSION: "3.12"
VAULT_VERSION: "1.17.3"
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set vars
id: vars
run: |
export COMMIT_SHA=${{ github.sha }}
echo "IMAGE_DATE_TAG='${COMMIT_SHA:0:8}-$(date +%Y%m%d)'" >> $GITHUB_OUTPUT
- name: build and push staging
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
staging
build-args: |
VAULT_VERSION=${{ env.VAULT_VERSION }}
- name: build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
${{ env.PYTHON_VERSION }}
latest
build-args: |
VAULT_VERSION=${{ env.VAULT_VERSION }}