47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: 'Build docker container'
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
workflow_dispatch:
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ${{ GITHUB_WORKSPACE }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Install Docker
|
|
run: |
|
|
echo "Checking docker installation"
|
|
if command -v docker &> /dev/null; then
|
|
echo "Docker installation found"
|
|
else
|
|
echo "Docker installation not found. Docker will be installed"
|
|
curl -fsSL https://get.docker.com | sh
|
|
fi
|
|
- name: Install Fetch
|
|
run: |
|
|
echo "Installing fetch"
|
|
if ! command -v node &> /dev/null; then
|
|
apt-get install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_24.x | bash
|
|
fi
|
|
package='node-fetch'
|
|
if [ `npm list -g | grep -c $package` -eq 0 ]; then
|
|
npm install $package --no-shrinkwrap
|
|
fi
|
|
- name: Login to DockerHub container registry
|
|
uses: https://github.com/docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
- name: Docker Hub Description
|
|
uses: peter-evans/dockerhub-description@v5
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
repository: davidquinonescl/hyperion-docker
|