Skip to content

Commit 44e9e26

Browse files
committed
Add github actions docker
1 parent fd293ac commit 44e9e26

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
9+
build:
10+
environment: docker-build
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
26+
- name: Build and push
27+
uses: docker/build-push-action@v2
28+
with:
29+
context: ./
30+
file: ./Dockerfile
31+
builder: ${{ steps.buildx.outputs.name }}
32+
push: true
33+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/textfsm101:latest
34+
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/textfsm101:buildcache
35+
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/textfsm101:buildcache,mode=max

0 commit comments

Comments
 (0)