Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
50 lines (46 loc) · 1.61 KB
/
Copy pathaction.yml
File metadata and controls
50 lines (46 loc) · 1.61 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
43
44
45
46
47
48
49
50
name: "Publish Image to Docker Hub"
description: |
Build and push the latest docker image to docker hub.
Four images will be pushed, `latest` and three semver images.
One will be the full semver image (major.minor.patch).
The second will be the major.minor version.
Third one will be just the major version.
inputs:
docker_username:
required: true
description: "secrets.DOCKER_USERNAME"
docker_password:
required: true
description: "secrets.DOCKER_PASSWORD"
docker_repository:
required: true
description: "name of the docker repository"
semver_version:
required: true
description: "The semver version to release (vX.X.X)"
# Define action steps
runs:
using: "composite"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
- name: Generate Docker Versions
id: docker_version
uses: SkynetLabs/.github/.github/actions/major-minor-version@master
with:
version: ${{ inputs.semver_version }}
docker_repository: ${{ inputs.docker_repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: |
${{ steps.docker_version.outputs.latest_image_tag }}
${{ steps.docker_version.outputs.semver_version_image_tag }}
${{ steps.docker_version.outputs.major_minor_version_image_tag }}
${{ steps.docker_version.outputs.major_version_image_tag }}