-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.31 KB
/
cd.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
name: CI
on:
push:
branches: [master]
tags: [v*]
pull_request:
branches: [master]
pull_request_target:
branches: [master]
jobs:
deploy:
name: Build and publish images in ghcr
runs-on: ubuntu-latest
# Run only on pushing a tag
strategy:
matrix:
image:
- "pyspark-jupyter"
- "pyspark"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get image tags
run: |
echo "IMAGE_TAGS=latest" >> "$GITHUB_ENV"
- name: Populate image release tags
if: startsWith(github.ref, 'refs/tags/')
run: |
echo IMAGE_TAGS="pipelines,${GITHUB_REF#refs/tags/},$IMAGE_TAGS" >> "$GITHUB_ENV"
- name: Build Docker Image
run: |
docker build -t ${{ matrix.image}} -f docker/${{ matrix.image }}.Dockerfile docker
- name: Push Docker Image
run: |
for tag in $(echo $IMAGE_TAGS | tr "," " "); do
dst_tag=ghcr.io/neuro-inc/${{ matrix.image }}:$tag
docker tag ${{ matrix.image }} $dst_tag
docker push $dst_tag
done