-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.07 KB
/
dockerhub-push.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
43
44
45
name: Docker Hub registry build and push
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Lowercase the repo name and username
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
-
name: Confirm tag name
run: echo "Tag name ${{ github.ref_name }}"
-
name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
VERSION=${{ github.ref_name }}
tags: ${{ env.REPO }}:${{ github.ref_name }}, ${{ env.REPO }}:latest
push: True