-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.55 KB
/
deploy.yaml
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
# GitHub Actions Workflow for Deployment
name: Deploy
on:
workflow_call:
inputs:
deploy_env:
type: string
required: true
description: Deployment Environment
artifacts_path:
type: string
required: true
permissions:
contents: read
env:
PYTHON_VIRTUALENV_ACTIVATE: .pyenv/bin/activate
jobs:
deploy:
name: Deploy
runs-on: ubuntu-22.04
environment: ${{ inputs.deploy_env }}
steps:
- name: Check Out VCS Repository
uses: actions/[email protected]
- name: Set Up Python
id: set_up_python
uses: actions/[email protected]
with:
python-version: "3.10.13"
- name: Restoring/Saving Cache
uses: actions/[email protected]
with:
path: ".pyenv"
key: py-v1-deps-${{ runner.os }}-${{ steps.set_up_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('Makefile', 'make/**.mk') }}
fail-on-cache-miss: true
- name: Restore Artifacts (Release)
uses: actions/[email protected]
with:
name: release
path: ${{ inputs.artifacts_path }}/
- name: Deploy
run: |
source "$PYTHON_VIRTUALENV_ACTIVATE"
make deploy \
TWINE_USERNAME="${PYPI_USERNAME:?}" \
TWINE_PASSWORD="${PYPI_PASSWORD:?}"
env:
PYPI_USERNAME: ${{ vars.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_NON_INTERACTIVE: "true"