-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (42 loc) · 1.12 KB
/
docker.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
45
46
47
48
49
50
name: deploy
on:
push:
branches:
- master
tags:
- '*.*.*'
jobs:
docker:
runs-on: ubuntu-20.04
name: Build and deploy docker image
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Get release tag
id: tag
run: |
case ${{ github.ref_name }} in
master)
echo name=latest >> $GITHUB_OUTPUT ;;
*.*.*)
echo name=release-${{ github.ref_name }} >> $GITHUB_OUTPUT ;;
*)
echo name=${{ github.ref_name }} >> $GITHUB_OUTPUT ;;
esac
- name: Login to Dockerhub
run: >
docker login
-u ${{ secrets.DOCKERHUB_USERNAME }}
-p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
run: >
docker build
-t galantelab/sandy:${{ steps.tag.outputs.name }}
-f docker/Dockerfile ./
- name: Push image to Dockerhub
run: docker push galantelab/sandy:${{ steps.tag.outputs.name }}
- name: Logout
run: docker logout