mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: 5.0.0
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
86 lines
2.8 KiB
YAML
86 lines
2.8 KiB
YAML
name: Push image (REUSABLE)
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
IMAGE:
|
|
required: true
|
|
type: string
|
|
TAGS:
|
|
required: true
|
|
type: string
|
|
CACHE_FROM:
|
|
required: true
|
|
type: string
|
|
DOCKERFILE:
|
|
required: true
|
|
type: string
|
|
secrets:
|
|
DOCKER_USERNAME:
|
|
required: true
|
|
DOCKER_TOKEN:
|
|
required: true
|
|
ARM_SSH_KEY:
|
|
required: true
|
|
ARM_SSH_CONFIG:
|
|
required: true
|
|
ARM_SSH_IP:
|
|
required: true
|
|
|
|
jobs:
|
|
push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Prepare
|
|
- name: Check out repository code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
- name: Login to ghcr
|
|
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Setup SSH for ARM node
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "$SSH_KEY" > ~/.ssh/id_rsa_arm
|
|
chmod 600 ~/.ssh/id_rsa_arm
|
|
echo "$SSH_CONFIG" | sed "s/SSH_IP/$SSH_IP/g" > ~/.ssh/config
|
|
echo "ServerAliveInterval 60" >> ~/.ssh/config
|
|
echo "ServerAliveCountMax 10" >> ~/.ssh/config
|
|
env:
|
|
SSH_KEY: ${{ secrets.ARM_SSH_KEY }}
|
|
SSH_IP: ${{ secrets.ARM_SSH_IP }}
|
|
SSH_CONFIG: ${{ secrets.ARM_SSH_CONFIG }}
|
|
- name: Setup Buildx (ARM)
|
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
|
with:
|
|
endpoint: ssh://root@arm
|
|
platforms: linux/arm64,linux/arm/v7
|
|
buildkitd-flags: --debug
|
|
# Compute metadata
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
|
|
with:
|
|
images: bunkerity/${{ inputs.IMAGE }}
|
|
# Build and push
|
|
- name: Build and push
|
|
continue-on-error: ${{ inputs.IMAGE == 'bunkerweb-all-in-one' }}
|
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
|
with:
|
|
context: .
|
|
file: ${{ inputs.DOCKERFILE }}
|
|
platforms: ${{ inputs.IMAGE == 'bunkerweb-all-in-one' && 'linux/amd64,linux/arm64' || 'linux/amd64,linux/386,linux/arm64,linux/arm/v7' }}
|
|
push: true
|
|
tags: ${{ inputs.TAGS }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: |
|
|
type=gha,scope=${{ inputs.CACHE_FROM }}-amd64
|
|
type=gha,scope=${{ inputs.CACHE_FROM }}-386
|
|
type=gha,scope=${{ inputs.CACHE_FROM }}-arm
|