Skip to content

Commit af89f9e

Browse files
authored
Create docker-image.yml
1 parent ccd1b6a commit af89f9e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/docker-image.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docker Push On Commit
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- test
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Log in to DockerHub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_USERNAME }}
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+
push: true
32+
tags: |
33+
0xChloe/spotiplex:${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
34+

0 commit comments

Comments
 (0)