-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (29 loc) · 1.03 KB
/
docker-image.yml
File metadata and controls
40 lines (29 loc) · 1.03 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
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: define-tag
id: define-image-tag
run:
echo "IMAGE_TAG_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/squid-https:1.0.0" >> $GITHUB_OUTPUT
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ steps.define-image-tag.outputs.IMAGE_TAG_NAME}}
- name: Latest Tag
run: docker image tag ${{ steps.define-image-tag.outputs.IMAGE_TAG_NAME}} ${{ secrets.DOCKER_HUB_USERNAME }}/squid-https:latest
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Push to Docker Hub
run:
docker push ${{ steps.define-image-tag.outputs.IMAGE_TAG_NAME}}
- name: Push Latest to Docker Hub
run:
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/squid-https:latest