61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Docker Build single node
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# Uncomment to run only when specific files change
|
|
# paths:
|
|
# - '**/ansible-navigator.yaml'
|
|
# - '**/execution-environment.yml'
|
|
|
|
env:
|
|
# Set this to the public IP or hostname of your registry,
|
|
# whichever you use to reach it from your desktop/laptop
|
|
FORGEJO_HOST: git.gamezonline.me
|
|
CONTAINER_NAME: radius
|
|
|
|
jobs:
|
|
build-image:
|
|
name: Build image
|
|
runs-on: debian-latest
|
|
container:
|
|
image: node:20-bookworm
|
|
options: >-
|
|
--privileged
|
|
env:
|
|
DOCKER_HOST: "tcp://docker:2375"
|
|
DOCKER_TLS_CERTDIR: ""
|
|
services:
|
|
docker:
|
|
image: docker:24.0.5-dind
|
|
options: >-
|
|
--privileged
|
|
env:
|
|
DOCKER_TLS_CERTDIR: ""
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Docker
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y ca-certificates curl gnupg
|
|
install -m 0755 -d /etc/apt/keyrings
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
|
chmod a+r /etc/apt/keyrings/docker.asc
|
|
# Add the repository to Apt sources:
|
|
echo \
|
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
|
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
|
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
apt-get update
|
|
apt-get install -y docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
provenance: false
|
|
tags: ${{ env.FORGEJO_HOST }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest |