-
Notifications
You must be signed in to change notification settings - Fork 13
44 lines (41 loc) · 1.29 KB
/
build-dask-image.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
name: Build and push dask image
on:
push:
branches:
- 'main'
paths:
- '.github/workflows/build-dask-image.yml'
- 'images/dask/**'
pull_request:
paths:
- '.github/workflows/build-dask-image.yml'
- 'images/dask/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build_push:
name: Package docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: curl -sSL https://install.python-poetry.org | python -
# from https://forcepush.tech/python-package-ci-cd-with-git-hub-actions
- name: Get image tag from version.txt
run: |
cd images/dask
PROJECT_VERSION=$(cat version.txt)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
- uses: docker/build-push-action@v2
with:
context: images/dask
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/${{github.repository}}/dask:${{env.PROJECT_VERSION}}