godash/.forgejo/workflows/build_deploy.yaml

36 lines
907 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:
2024-10-31 09:27:01 +01:00
prepare:
2024-10-31 09:35:03 +01:00
runs-on: ubuntu-latest
2024-10-31 08:14:53 +01:00
steps:
2024-10-31 09:35:03 +01:00
- name: Checkout
2024-10-31 09:13:16 +01:00
uses: actions/checkout@v4
2024-10-31 09:35:03 +01:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Forgejo Container Registry
2024-10-31 09:13:16 +01:00
uses: docker/login-action@v3
with:
2024-10-31 09:35:03 +01:00
registry: git.unjx.de
2024-10-31 09:13:16 +01:00
username: ${{ github.actor }}
password: ${{ github.token }}
2024-10-31 10:02:26 +01:00
- name: Build
2024-10-31 09:13:16 +01:00
uses: docker/build-push-action@v6
with:
tags: ${{ env.LATEST_IMAGE }}
build-args: |
V_GOLANG=${{ vars.V_GOLANG }}
V_NODE=${{ vars.V_NODE }}
V_ALPINE=${{ vars.V_ALPINE }}
2024-10-31 10:02:26 +01:00
- name: Push
run: docker push ${{ env.LATEST_IMAGE }}