-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (38 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
name: Docker
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 6' # every Saturday
workflow_dispatch:
jobs:
push:
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4
- name: Extract metadata for Docker
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
id: meta
uses: docker/metadata-action@v5
with:
images: codingteam/codingteam.org.ru
tags: type=ref,event=branch
- name: Login to Docker Hub
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Images
uses: docker/build-push-action@v6
with:
tags: |
${{ steps.meta.outputs.tags }}
codingteam/codingteam.org.ru:latest
push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') && 'true' || 'false' }}