2023-02-20 01:42:14 +00:00
|
|
|
name: Silvanus Production Dockerization
|
|
|
|
|
|
|
|
on:
|
2023-07-31 20:03:25 +00:00
|
|
|
pull_request:
|
2023-07-31 19:44:17 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2023-02-20 01:42:14 +00:00
|
|
|
|
|
|
|
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
|
2023-02-20 01:42:14 +00:00
|
|
|
|
|
|
|
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
|
2023-02-20 01:42:14 +00:00
|
|
|
- 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
|