Skip to content

Commit b344d30

Browse files
authored
Create build-containerimage.yml
1 parent d4dd693 commit b344d30

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build Containerimage
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
schedule:
8+
- cron: '55 10 * * *'
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Containerimage to Docker Hub
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Set output
20+
id: vars
21+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
22+
23+
- name: Check output
24+
env:
25+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
26+
run: |
27+
echo $RELEASE_VERSION
28+
echo ${{ steps.vars.outputs.tag }}
29+
30+
- name: Login to Docker Hub
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKER_USERNAME }}
34+
password: ${{ secrets.DOCKER_PASSWORD }}
35+
36+
- name: build
37+
run: docker build . --file Containerfile --tag ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:${{ steps.vars.outputs.tag }} --tag ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:latest
38+
39+
- name: push
40+
run: docker image push --all-tags ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}

0 commit comments

Comments
 (0)