-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 1.75 KB
/
docker-build-push.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build and Push to Docker Hub
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
push:
tags:
- '**'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set env for dynamic tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set env manual
if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=default_version" >> $GITHUB_ENV
- name: Checkout code
uses: actions/[email protected]
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: naritter
password: ${{ secrets.DOCKERHUB_PASSWORD}}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: docker.io/naritter/seb-sps-gui:${{ env.TAG_NAME }}
build-and-push2:
runs-on: ubuntu-latest
steps:
- name: Set env for dynamic tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set env manual
if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=default_version123" >> $GITHUB_ENV
- name: Checkout code
uses: actions/[email protected]
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: naritter
password: ${{ secrets.DOCKERHUB_PASSWORD}}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: docker.io/naritter/seb-sps-gui:${{ env.TAG_NAME }}