2024-10-31 08:14:53 +01:00
|
|
|
name: Build and Push Docker Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
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: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2024-10-31 10:07:52 +01:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
with:
|
|
|
|
images: git.unjx.de/${{ github.repository }}
|
|
|
|
tags: |
|
2024-10-31 10:18:07 +01:00
|
|
|
type=raw,value=latest
|
2024-10-31 10:07:52 +01:00
|
|
|
labels: |
|
2024-10-31 14:30:15 +01:00
|
|
|
maintainer=${{ github.actor }}
|
2024-10-31 10:07:52 +01:00
|
|
|
org.opencontainers.image.title=GoDash
|
2024-10-31 14:30:15 +01:00
|
|
|
org.opencontainers.image.licenses=Apache-2.0
|
|
|
|
org.opencontainers.image.description=Blazing fast start page for your services
|
2024-10-31 10:07:52 +01:00
|
|
|
org.opencontainers.image.vendor=Unjx
|
2024-10-31 09:35:03 +01:00
|
|
|
- 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 }}
|
2024-10-31 10:43:13 +01:00
|
|
|
password: ${{ secrets.CI_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:
|
2024-10-31 10:18:07 +01:00
|
|
|
push: true
|
2024-10-31 10:07:52 +01:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
2024-10-31 09:13:16 +01:00
|
|
|
build-args: |
|
|
|
|
V_GOLANG=${{ vars.V_GOLANG }}
|
|
|
|
V_NODE=${{ vars.V_NODE }}
|
|
|
|
V_ALPINE=${{ vars.V_ALPINE }}
|
2024-10-31 14:30:15 +01:00
|
|
|
APP_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
|
|
|
BUILD_TIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
2024-10-31 10:43:13 +01:00
|
|
|
secrets: |
|
|
|
|
GIT_AUTH_TOKEN=${{ secrets.CI_TOKEN }}
|