-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (32 loc) · 1.21 KB
/
docker-image.yml
File metadata and controls
44 lines (32 loc) · 1.21 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
42
43
44
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: define-tag
id: define-image-tag
run:
echo "IMAGE_TAG_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/https-proxy-test:${{ steps.package-version.outputs.current-version}}-$(date +%s)" >> $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 }}/https-proxy-test: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 }}/https-proxy-test:latest