Skip to content

Commit de499f8

Browse files
authored
Create docker.yml github action
1 parent 31966f7 commit de499f8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/docker.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and push
2+
3+
on:
4+
push:
5+
branches: [ "master", "dev" ]
6+
pull_request:
7+
branches: [ "master", "dev" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Login to Docker Hub
14+
- uses: docker/login-action@v3
15+
- with:
16+
username: ${{ secrets.DOCKERHUB_USERNAME }}
17+
password: ${{ secrets.DOCKERHUB_TOKEN }}
18+
19+
- name: Set up Docker Buildx
20+
- uses: docker/setup-buildx-action@v3
21+
22+
- uses: actions/checkout@v4
23+
- name: Build the Docker image
24+
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
25+
26+
- name: Build and push
27+
uses: docker/build-push-action@v6
28+
with:
29+
push: true
30+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ssh-key-authority:latest-${{ vars.GITHUB_REF_NAME }}

0 commit comments

Comments
 (0)