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:
|
2024-10-31 09:27:01 +01:00
|
|
|
prepare:
|
2024-10-31 09:18:50 +01:00
|
|
|
runs-on: docker
|
2024-10-31 08:14:53 +01:00
|
|
|
steps:
|
2024-10-31 09:13:16 +01:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
2024-10-31 09:27:01 +01:00
|
|
|
build_and_push:
|
|
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
2024-10-31 09:13:16 +01:00
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
tags: ${{ env.LATEST_IMAGE }}
|
|
|
|
build-args: |
|
|
|
|
V_GOLANG=${{ vars.V_GOLANG }}
|
|
|
|
V_NODE=${{ vars.V_NODE }}
|
|
|
|
V_ALPINE=${{ vars.V_ALPINE }}
|