silvanus/.github/workflows/docker-image-prod.yml

35 lines
751 B
YAML
Raw Permalink Normal View History

name: Silvanus Production Dockerization
on:
2023-07-31 20:03:25 +00:00
pull_request:
branches:
- main
env:
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
jobs:
build:
2023-07-31 20:21:21 +00:00
runs-on: self-hosted
steps:
2023-07-31 20:40:48 +00:00
- name: Pull latest from Git
run: |
2023-07-31 20:41:52 +00:00
pwd
whoami
2023-07-31 20:43:54 +00:00
cd /root/silvanus
2023-07-31 20:40:48 +00:00
git pull
git checkout $GITHUB_HEAD_REF
2023-07-31 20:12:58 +00:00
- name: Build the Docker image
2023-07-31 20:40:48 +00:00
run: |
2023-07-31 20:43:54 +00:00
cd /root/silvanus
2023-07-31 20:40:48 +00:00
docker build . --file Dockerfile --tag v0idf1sh/silvanus
- name: Log into Docker Hub
run: docker login -u $DHUB_UNAME -p $DHUB_PWORD
2023-07-31 20:12:58 +00:00
- name: Push image to Docker Hub
2023-07-31 20:40:48 +00:00
run: |
2023-07-31 20:43:54 +00:00
cd /root/silvanus
2023-07-31 20:40:48 +00:00
docker push v0idf1sh/silvanus