create new github action for automated deployment

This commit is contained in:
Michi 2024-10-12 13:13:33 +02:00
parent 7522a8026f
commit 06ba3ef0e1
2 changed files with 25 additions and 18 deletions

View file

@ -1,18 +0,0 @@
name: Docker-Hub-Autopublishing
on:
push:
tags:
- '*'
jobs:
build:
runs-on: debian-latest
steps:
- uses: actions/checkout@v1
- name: Build docker image and push to docker hub
run: |
echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u michivonah --password-stdin
docker image build -t michivonah/ep-alerts:latest .
docker push michivonah/ep-alerts:latest

25
.github/workflows/image-build.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Build Docker Image
on:
push:
branches:
- main
jobs:
build:
name: push docker image to docker hub
runs-on: debian-latest
steps:
- uses: actions/checkout@v2
- name: login to docker hub
id: docker-hub
env:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}
run: |
docker login -u $username -p $password
- name: build the docker image
id: build-docker-image
run: |
docker build -t michivonah/ep-alerts:latest .
- name: push the docker image
id: push-docker-image
run: docker push michivonah/ep-alerts:latest