godash/.forgejo/workflows/build_deploy.yaml

31 lines
719 B
YAML
Raw Normal View History

2024-10-31 08:14:53 +01:00
name: Build and Push Docker Image
on:
push:
branches:
- main
env:
2024-10-31 08:28:48 +01:00
REGISTRY: git.unjx.de
LATEST_IMAGE: ${{ env.REGISTRY }}/${{ github.repository }}:latest
2024-10-31 08:14:53 +01:00
jobs:
build:
runs-on: self-hosted
steps:
2024-10-31 08:28:48 +01:00
- run: echo $${{ github.token }} | docker login --username flohoss --password-stdin ${{ env.REGISTRY }}
2024-10-31 08:14:53 +01:00
- run: |
docker build \
--build-arg V_GOLANG=${{ vars.V_GOLANG }} \
--build-arg V_NODE=${{ vars.V_NODE }} \
--build-arg V_ALPINE=${{ vars.V_ALPINE }} \
--tag ${{ env.LATEST_IMAGE }} \
--push .
cleanup:
runs-on: self-hosted
needs: build
steps:
- run: |
docker system prune -a -f