-
Notifications
You must be signed in to change notification settings - Fork 127
36 lines (29 loc) · 998 Bytes
/
push-docker-hub.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
name: "ElectricEye on Docker Hub"
on:
push:
branches: [ master ]
jobs:
ElectricEyeOnDockerHub:
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
IMAGE_TAG: ${{ github.sha }}
steps:
# Checkout le branch
- name: Checkout
uses: actions/checkout@v4
# Log in to Docker Hub
- name: Docker Hub Login
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
# Build, Tag, Push to Docker Hub
- name: Build, Tag, Push Image to Docker Hub
id: tag-and-push-image
run: |
docker build -t electriceye/electriceye:$IMAGE_TAG .
docker tag electriceye/electriceye:$IMAGE_TAG electriceye/electriceye:latest
docker push electriceye/electriceye:$IMAGE_TAG
docker push electriceye/electriceye:latest
# Print the location
- name: Print Image
run: echo "electriceye/electriceye:$IMAGE_TAG"