-
Notifications
You must be signed in to change notification settings - Fork 487
32 lines (25 loc) · 929 Bytes
/
docker-image.yaml
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
name: Docker Image CI
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Generate a timestamp and store it in a variable
- name: Generate Timestamp
id: timestamp
run: echo "::set-output name=timestamp::$(date +%s)"
- name: Build the Docker image
run: |
TIMESTAMP="${{ steps.timestamp.outputs.timestamp }}"
docker build . --file Dockerfile --tag 0001coder/chatollama:${TIMESTAMP}
docker tag 0001coder/chatollama:${TIMESTAMP} 0001coder/chatollama:latest
- name: Log in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Push Docker image to registry
run: |
TIMESTAMP="${{ steps.timestamp.outputs.timestamp }}"
docker push 0001coder/chatollama:${TIMESTAMP}
docker push 0001coder/chatollama:latest