-
Notifications
You must be signed in to change notification settings - Fork 14
42 lines (36 loc) · 1.32 KB
/
docker-cd.yml
File metadata and controls
42 lines (36 loc) · 1.32 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
name: Docker Image CD
#These are the events that this workflow will be triggered for
on:
push:
branches: [ DevOps ]
pull_request:
branches: [ DevOps ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout our git repository
- uses: actions/checkout@v3
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.6.0
# Log in to docker to be able to push to our profile
- name: Docker Login
uses: docker/login-action@v1.14.1
with:
# Username used to log against the Docker registry
username: ${{ secrets.DOCKERHUB_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# We build our docker image and then push to docker hub
- name: Build and push Docker images
# You may pin to the exact commit or the version.
# uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
uses: docker/build-push-action@v2.10.0
with:
# Build's context is the set of files located in the specified PATH or URL
context: ./StackLite
# Path to the Dockerfile
file: ./DockerFile
tags: index.docker.io/${{secrets.DOCKERHUB_USERNAME}}/stacklite:${{github.sha}}
push: true