-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (31 loc) · 933 Bytes
/
main.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
name: Test and Deploy
on:
push:
branches: [ 'master' ]
tags: [ '*' ]
workflow_dispatch:
jobs:
build_push_docker_image:
runs-on: ubuntu-latest
# only deploy master and tagged releases
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Grab git tag names for docker tag
id: meta
uses: docker/metadata-action@v4
with:
images: ubcctlt/rserve
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}