forked from SecureAI-Tools/SecureAI-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 935 Bytes
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ "publish_changes" ]
pull_request:
branches: [ "publish_changes" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker tags
id: tags
run: |
TIMESTAMP=$(date +%s)
echo "::set-output name=timestamp::$TIMESTAMP"
echo "::set-output name=latest::latest"
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ahmadmujahid/secure-ai-tools:${{ steps.tags.outputs.timestamp }}
ahmadmujahid/secure-ai-tools:${{ steps.tags.outputs.latest }}
- name: Logout from Docker Hub
run: docker logout