All checks were successful
Build and Publish Docker Image / build (push) Successful in 3m45s
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
name: Build and Publish Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ gitea.server_url }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.PAT }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
git.toomuchtaco.net/${{ gitea.repository }}:latest
|
|
git.toomuchtaco.net/${{ gitea.repository }}:${{ gitea.sha }}
|
|
|
|
|
|
- name: Pull and Redeploy Komodo Stack
|
|
run: |
|
|
curl --header "Content-Type: application/json" \
|
|
--header "X-Api-Key: ${{ secrets.KOMODO_API_KEY }}" \
|
|
--header "X-Api-Secret: ${{ secrets.KOMODO_API_SECRET }}" \
|
|
--data '{ "stack": "${{ secrets.KOMODO_STACK }}" }' \
|
|
${{ secrets.KOMODO_HOST }}/execute/PullStack
|
|
curl --header "Content-Type: application/json" \
|
|
--header "X-Api-Key: ${{ secrets.KOMODO_API_KEY }}" \
|
|
--header "X-Api-Secret: ${{ secrets.KOMODO_API_SECRET }}" \
|
|
--data '{ "stack": "${{ secrets.KOMODO_STACK }}" }' \
|
|
${{ secrets.KOMODO_HOST }}/execute/DeployStack |