Skip to content

Commit 7dce172

Browse files
committed
Update workflow order
1 parent b588cb7 commit 7dce172

File tree

2 files changed

+62
-18
lines changed

2 files changed

+62
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,65 @@ jobs:
3434
- name: Run linters
3535
run: |
3636
make lint
37+
38+
info:
39+
name: Prepare release
40+
runs-on: ubuntu-latest
41+
needs: [lint]
42+
timeout-minutes: 5
43+
outputs:
44+
version: ${{ steps.version.outputs.version }}
45+
name: ${{ steps.version.outputs.name }}
46+
steps:
47+
- name: Checkout commit
48+
uses: actions/checkout@v2
49+
with:
50+
ref: ${{ github.event.workflow_run.head_sha }}
51+
fetch-depth: 0
52+
- name: Setup Python 3.9
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: '3.9'
56+
- name: Cache PyPI
57+
uses: actions/[email protected]
58+
with:
59+
key: pip-lint-${{ hashFiles('requirements/*.txt') }}
60+
path: ~/.cache/pip
61+
restore-keys: |
62+
pip-lint-
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install pip
66+
make setup
67+
- name: Save the package version
68+
id: version
69+
run: |
70+
echo "::set-output name=version::$(python setup.py --version)"
71+
echo "::set-output name=name::$(python setup.py --name)"
72+
- name: Show version
73+
run: |
74+
echo ${{ steps.version.outputs.name }}==${{ steps.version.outputs.version }}
75+
76+
build_image:
77+
name: Build image
78+
runs-on: ubuntu-latest
79+
needs: [info]
80+
steps:
81+
- name: Purge old artifacts
82+
uses: kolpav/purge-artifacts-action@v1
83+
with:
84+
token: ${{ secrets.GH_TOKEN }}
85+
expire-in: 30mins
86+
- name: Checkout commit
87+
uses: actions/checkout@v2
88+
with:
89+
ref: ${{ github.event.workflow_run.head_sha }}
90+
fetch-depth: 0
91+
- name: Build release image
92+
run: |
93+
docker build -t ${{ needs.info.outputs.name }} .
94+
- name: Store image in run's artifacts
95+
uses: neuro-inc/[email protected]
96+
with:
97+
image: ${{ needs.info.outputs.name }}
98+
token: ${{ secrets.GH_TOKEN }}

.github/workflows/publish-image.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,6 @@ jobs:
5353
runs-on: ubuntu-latest
5454
needs: [info]
5555
steps:
56-
- name: Purge old artifacts
57-
uses: kolpav/purge-artifacts-action@v1
58-
with:
59-
token: ${{ secrets.GH_TOKEN }}
60-
expire-in: 30mins
61-
- name: Checkout commit
62-
uses: actions/checkout@v2
63-
with:
64-
ref: ${{ github.event.workflow_run.head_sha }}
65-
fetch-depth: 0
66-
- name: Build release image
67-
run: |
68-
docker build -t ${{ needs.info.outputs.name }} .
69-
- name: Store image in run's artifacts
70-
uses: neuro-inc/[email protected]
71-
with:
72-
image: ${{ needs.info.outputs.name }}
73-
token: ${{ secrets.GH_TOKEN }}
7456
- name: Push image to Github
7557
id: release
7658
uses: neuro-inc/[email protected]

0 commit comments

Comments
 (0)