This commit is contained in:
parent
6dcd99ed89
commit
9dca8c9cce
2 changed files with 4 additions and 26 deletions
|
|
@ -2,33 +2,11 @@ on:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
deploy:
|
||||||
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
env:
|
|
||||||
DOCKER_HOST: tcp://127.0.0.1:2376
|
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
options: --network host
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Log in to Forgejo registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ${{ env.GITHUB_SERVER_URL }}
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set registry host
|
|
||||||
run: echo "REGISTRY_HOST=${GITHUB_SERVER_URL#https://}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ env.REGISTRY_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
|
||||||
|
|
||||||
- name: Trigger Portainer redeploy
|
- name: Trigger Portainer redeploy
|
||||||
run: curl -k -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
run: curl -fsSk -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ name: karsttech-website
|
||||||
|
|
||||||
services:
|
services:
|
||||||
hugo-site:
|
hugo-site:
|
||||||
image: code.karsttech.com/jeremy/karsttech.com:latest
|
build: .
|
||||||
container_name: karsttech-website
|
container_name: karsttech-website
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8317:80"
|
- "8317:80"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue