-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.12 KB
/
Copy pathdocker-image.yml
File metadata and controls
41 lines (33 loc) · 1.12 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
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Build and push Docker image
run: |
TIMESTAMP=$(date +%s)
REPOSITORY=${{ vars.DOCKER_USERNAME }}/kv
docker build . --file Dockerfile \
--tag ${REPOSITORY}:${TIMESTAMP} \
--tag ${REPOSITORY}:latest
docker push ${REPOSITORY}:${TIMESTAMP}
docker push ${REPOSITORY}:latest
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
repository: ${{ vars.DOCKER_USERNAME }}/kv
readme-filepath: ./README.md
short-description: "Lightweight, high performance key-value store with HTTP API. Built with ReactPHP and SQLite"