Repository navigation
60 lines (60 loc) · 1.67 KB
/
Copy pathdeploy.yaml
File metadata and controls
60 lines (60 loc) · 1.67 KB
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
name: Deploy to Docker Hub
on:
schedule:
- cron: '0 10 * * *'
push:
branches: [main]
tags: ['**']
paths-ignore: ['*.md']
pull_request:
branches: [main]
jobs:
deploy:
name: Build Docker image
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- target: single
latest: true
suffix: ''
- target: parallel
latest: false
suffix: -parallel
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: csquareai/ml-default
flavor: |
latest=${{ matrix.latest }}
prefix=
suffix=${{ matrix.suffix }}
tags: |
type=schedule
type=edge,branch=main
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern=${{ matrix.target }},suffix=
type=sha
- name: Build and push image to DockerHub
uses: docker/build-push-action@v2
with:
context: .
target: ${{ matrix.target }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}