-
Notifications
You must be signed in to change notification settings - Fork 24
40 lines (33 loc) · 1.07 KB
/
dockerhub.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
name: docker-push-dockerhub
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to docker.io
uses: docker/[email protected]
with:
registry: docker.io
username: ${{ secrets.DOCKER_NAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date -u '+%F-%T')"
- name: Get short SHA
id: sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
COMMITHASH=${{ steps.sha.outputs.sha }}
BUILDTIME=${{ steps.date.outputs.date }}
tags: docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:latest, docker.io/${{ secrets.DOCKER_NAME }}/moksha-mint:${{ steps.sha.outputs.sha }}