60 lines
2.1 KiB
YAML
60 lines
2.1 KiB
YAML
name: Build
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '30 4 * * 6'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: docker
|
|
container: debian:12
|
|
strategy:
|
|
matrix:
|
|
images:
|
|
- name: ubuntu
|
|
tag: 24.04
|
|
steps:
|
|
- name: Install NodeJS
|
|
shell: sh
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh && bash nodesource_setup.sh
|
|
apt-get install -y nodejs
|
|
node -v
|
|
# https://docs.docker.com/engine/install/debian/#install-using-the-repository
|
|
- name: Install Docker
|
|
shell: sh
|
|
run: |
|
|
apt-get install ca-certificates curl
|
|
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
|
|
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 docker-buildx-plugin
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Extract Registry Hostname
|
|
shell: bash
|
|
run: |
|
|
SERVER_URL="${{ github.server_url }}"
|
|
HOSTNAME="${SERVER_URL#https://}"
|
|
echo "Hostname: HOSTNAME"
|
|
echo "DOCKER_REGISTRY_HOST=$HOSTNAME" >> "$GITHUB_ENV"
|
|
- name: Login to Forgejo Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ github.server_url }}
|
|
username: ${{ vars.CONTAINER_USER }}
|
|
password: ${{ secrets.CONTAINER_PASSWORD }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./images/${{ matrix.images.name }}/${{ matrix.images.tag }}
|
|
push: true
|
|
tags: ${{ env.DOCKER_REGISTRY_HOST }}/${{ github.repository_owner }}/${{ matrix.images.name }}:${{ matrix.images.tag }}
|
|
no-cache: true
|