-
Notifications
You must be signed in to change notification settings - Fork 27
35 lines (27 loc) · 954 Bytes
/
docker-nginx-push.yml
File metadata and controls
35 lines (27 loc) · 954 Bytes
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
name: Docker Nginx Push CI
on:
workflow_dispatch:
inputs:
docker_username:
description: "Docker Hub Username"
required: true
default: ""
docker_password:
description: "Docker Hub Password"
required: true
default: ""
type: password
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
run: echo "${{ github.event.inputs.docker_password }}" | docker login -u "${{ github.event.inputs.docker_username }}" --password-stdin
- name: Build the Docker image
run: |
cd nginx-image/
docker build . --file Dockerfile --tag my-image-name:$(date -I)
docker tag my-image-name:$(date -I) ${{ github.event.inputs.docker_username }}/my-image-name:latest
- name: Push the Docker image
run: docker push ${{ github.event.inputs.docker_username }}/my-image-name:latest