35 lines
No EOL
993 B
YAML
35 lines
No EOL
993 B
YAML
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: self-hosted
|
|
env:
|
|
DOCKER_HOST: tcp://172.17.0.1:2376
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
options: --network host
|
|
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
|
|
run: curl -k -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}" |