2023-05-18 16:07:04 +00:00
|
|
|
name: Build and push image
|
|
|
|
|
2023-05-18 15:48:04 +00:00
|
|
|
on:
|
2023-05-18 15:49:23 +00:00
|
|
|
push:
|
2023-05-18 16:07:04 +00:00
|
|
|
branches: [main]
|
2023-05-18 15:48:04 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-05-18 16:07:04 +00:00
|
|
|
deploy:
|
|
|
|
runs-on: self-hosted
|
2023-05-18 15:49:23 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
2023-05-18 16:07:04 +00:00
|
|
|
working-directory: /repo
|
2023-05-18 15:48:04 +00:00
|
|
|
steps:
|
2023-05-18 16:07:04 +00:00
|
|
|
- name: Set git remote if not already set
|
|
|
|
run: git remote -v | grep -w gitea || git remote add gitea "./gitea/git/repositories/${GITHUB_REPOSITORY,,}.git"
|
|
|
|
|
|
|
|
- name: Checkout repo
|
|
|
|
run: git pull gitea main
|
|
|
|
|
|
|
|
- name: Deploy
|
2023-05-18 15:49:23 +00:00
|
|
|
run: |
|
2023-05-18 16:07:04 +00:00
|
|
|
docker build -t rynomarree/self-hosted-deployment:latest .
|