-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (35 loc) · 1.1 KB
/
docker.yaml
File metadata and controls
42 lines (35 loc) · 1.1 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
name: Push to dockerhub
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: 'Pull sources'
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.MOVY_DOCKER_USERNAME }}
password: ${{ secrets.MOVY_DOCKER_PAT }}
- name: Build and push
if: "!startsWith(github.ref, 'refs/tags')"
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: movyrs/movy:latest
- name: Build and push with github ref
if: "startsWith(github.ref, 'refs/tags')"
uses: docker/build-push-action@v6
with:
push: true
tags: |
movyrs/movy:latest
movyrs/movy:${{github.ref_name}}