Compare commits
37 Commits
352b088c97
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 116de4f9f1 | |||
| 9771afebb0 | |||
| 23516993e5 | |||
| ec7c4b2b65 | |||
| a54ded29e8 | |||
| 79835d2560 | |||
| 3bd16a1efd | |||
| 1e6222dfd8 | |||
| 9cafba8d91 | |||
| bb69d9f5ec | |||
| d6a4b3314c | |||
| 277f313a6c | |||
| 5393200d1d | |||
| 72f6f5d0d3 | |||
| bc835b45ef | |||
| 4d54b9aad7 | |||
| 844cef19fd | |||
| 9e181eda49 | |||
| 6de0f13416 | |||
| 8e1b209405 | |||
| a1587364e6 | |||
| 33862002e7 | |||
| e510e63c67 | |||
| c8e6e2c797 | |||
| 10581e5d5d | |||
| eaf41baf22 | |||
| a806905b40 | |||
| 7827745c11 | |||
| 0a1f221b40 | |||
| b0b2a3e950 | |||
| 980f487f4b | |||
| df4c0a12fa | |||
| 99bac4e6e1 | |||
| 7de41c8bfd | |||
| 6ad30d3826 | |||
| a7d09be523 | |||
| f86c841167 |
29
.gitea/workflows/ansible-builder.yml
Normal file
29
.gitea/workflows/ansible-builder.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Build Ansible Image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- ansible/*
|
||||||
|
env:
|
||||||
|
image: shockrah/ansible
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-ansible-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build docker image
|
||||||
|
run: docker build -t ${{ env.image }} ${{ gitea.workspace }}/ansible
|
||||||
|
push-to-docker-hub:
|
||||||
|
needs: bulid-anisble-image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.dockerhub_pass }}" | \
|
||||||
|
docker login -u ${{ secrets.dockerhub_user }} --password-stdin
|
||||||
|
- name: Push Docker image from previous job
|
||||||
|
run: docker push ${{ env.image }}
|
||||||
|
|
||||||
30
.gitea/workflows/hugo-builder.yml
Normal file
30
.gitea/workflows/hugo-builder.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Build Hugo Image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- website/*
|
||||||
|
|
||||||
|
env:
|
||||||
|
image: shockrah/hugo
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-hugo-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build docker image
|
||||||
|
run: docker build -t ${{ env.image }} ${{ gitea.workspace }}/website
|
||||||
|
push-to-docker-hub:
|
||||||
|
needs: build-hugo-image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.dockerhub_pass }}" | \
|
||||||
|
docker login -u ${{ secrets.dockerhub_user }} --password-stdin
|
||||||
|
- name: Push Docker image from previous job
|
||||||
|
run: docker push ${{ env.image }}
|
||||||
|
|
||||||
29
.gitea/workflows/minecraft-builder.yml
Normal file
29
.gitea/workflows/minecraft-builder.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Build Minecraft Image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- minecraft/*
|
||||||
|
|
||||||
|
env:
|
||||||
|
image: shockrah/minecraft
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-minecraft-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build docker image
|
||||||
|
run: docker build -t ${{ env.image }} ${{ gitea.workspace }}/website
|
||||||
|
push-to-docker-hub:
|
||||||
|
needs: build-hugo-image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.dockerhub_pass }}" | \
|
||||||
|
docker login -u ${{ secrets.dockerhub_user }} --password-stdin
|
||||||
|
- name: Push Docker image from previous job
|
||||||
|
run: docker push ${{ env.image }}
|
||||||
@@ -1,11 +1,19 @@
|
|||||||
stages:
|
include:
|
||||||
- build
|
- local: 'ci/builder.yml'
|
||||||
|
|
||||||
dummy:
|
build-ansible-image:
|
||||||
stage: build
|
extends: .builder
|
||||||
image: alpine:latest
|
|
||||||
script:
|
script:
|
||||||
- echo $env_var
|
- sh build-image.sh ansible
|
||||||
- echo $env_file
|
|
||||||
- cat $env_file
|
build-website-image:
|
||||||
|
extends: .builder
|
||||||
|
script:
|
||||||
|
- sh build-image.sh website
|
||||||
|
|
||||||
|
|
||||||
|
build-selelium-image:
|
||||||
|
extends: .builder
|
||||||
|
script:
|
||||||
|
- sh build-image.sh selenium
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
# Inpsired by William Yeh's Docker image however this one is kept up to date
|
# Inpsired by William Yeh's Docker image however this one is kept up to date
|
||||||
# with the latest base image versions available
|
# with the latest base image versions available, and includes ansible-lint
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
MAINTAINER shockrah :^)
|
RUN apk --update add sudo python3 git openssl ca-certificates openssh-client rsync && \
|
||||||
|
|
||||||
RUN apk --update add sudo python3 openssl ca-certificates openssh-client rsync && \
|
|
||||||
apk --update add --virtual build-dependencies \
|
apk --update add --virtual build-dependencies \
|
||||||
python3-dev libffi-dev openssl-dev build-base && \
|
python3-dev libffi-dev openssl-dev build-base \
|
||||||
python3 -m ensurepip && \
|
ansible py3-ansible-lint && \
|
||||||
pip3 install --upgrade pip cffi && \
|
|
||||||
pip3 install ansible && \
|
|
||||||
apk del build-dependencies && \
|
apk del build-dependencies && \
|
||||||
rm -rf /var/cache/apk/* && \
|
rm -rf /var/cache/apk/* && \
|
||||||
mkdir -p /etc/ansible && \
|
mkdir -p /etc/ansible && \
|
||||||
@@ -20,5 +16,3 @@ RUN apk --update add sudo python3 openssl ca-certificates openssh-client rsync &
|
|||||||
CMD ["ansible-playbook", "--version"]
|
CMD ["ansible-playbook", "--version"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
35
build-image.sh
Normal file
35
build-image.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# This script is a generic builder script which only builds
|
||||||
|
# images if the latest commit modifies the given folder in some way
|
||||||
|
|
||||||
|
target="$1"
|
||||||
|
tag="$2"
|
||||||
|
|
||||||
|
# Ensure we have a target
|
||||||
|
if [ -z "$target" ]; then
|
||||||
|
echo "$target is not defined ( empty )"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make sure the target is real
|
||||||
|
if [ ! -d "$target" ]; then
|
||||||
|
echo "$target is not a directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set the tag if not already set
|
||||||
|
if [ -z "$tag" ]; then
|
||||||
|
tag=latest
|
||||||
|
echo "Tag for \"$target\" defaulting to \"latest\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Finally set the project root
|
||||||
|
PROJECT_ROOT=`pwd`
|
||||||
|
|
||||||
|
cd "$target"
|
||||||
|
echo docker build . -t "$tag"
|
||||||
|
echo "${DOCKERHUB_PASSWORD} | docker login --username "${DOCKERHUB_USERNAME}" --password-stdin
|
||||||
|
cd "$PROJECT_ROOT"
|
||||||
17
ci/builder.yml
Normal file
17
ci/builder.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# This template is for the main builder jobs to inherit generic properties from
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- publish
|
||||||
|
|
||||||
|
.builder:
|
||||||
|
image: docker:stable
|
||||||
|
stage: publish
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
only:
|
||||||
|
refs:
|
||||||
|
- master
|
||||||
|
# Login to the docker registry to push
|
||||||
|
before_script:
|
||||||
|
- docker login -u $DOCKER_USERNAME --password-stdin <<< $TOKEN
|
||||||
|
|
||||||
3
minecraft/Dockerfile
Normal file
3
minecraft/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Super basic test thing
|
||||||
|
FROM itzg/minecraft-server
|
||||||
|
ENV EULA=TRUE
|
||||||
@@ -3,12 +3,19 @@
|
|||||||
This repository serves as a place of consolidation for most of the major public
|
This repository serves as a place of consolidation for most of the major public
|
||||||
docker images that I maintain.
|
docker images that I maintain.
|
||||||
|
|
||||||
|
# Building
|
||||||
|
|
||||||
|
Workflow for is defined as such in 3 stages:
|
||||||
|
|
||||||
|
* Validation stage: where we lint and check any
|
||||||
|
|
||||||
|
|
||||||
# Update Cycle
|
# Update Cycle
|
||||||
|
|
||||||
I mostly update these for my own sake however special versioning cycles can be
|
I mostly update these for my own sake however special versioning cycles can be
|
||||||
arranged for those that that request it.
|
arranged for those that that request it.
|
||||||
|
|
||||||
Email: `dev@shockrah.xyz`
|
Email: `mail@shockrah.xyz`
|
||||||
|
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|||||||
11
scp-action/Dockerfile
Normal file
11
scp-action/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Runs on Alpine container, latest version.
|
||||||
|
FROM alpine
|
||||||
|
# Copy the content to the container.
|
||||||
|
COPY . /
|
||||||
|
# Grant executable permission on the script.
|
||||||
|
RUN ["chmod", "+x", "/entrypoint.sh"]
|
||||||
|
# Update the apk and download openssh
|
||||||
|
RUN ["apk", "update"]
|
||||||
|
RUN ["apk", "add", "git", "openssh"]
|
||||||
|
# Runs the script.
|
||||||
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||||
21
scp-action/LICENSE
Normal file
21
scp-action/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Sebastian Rueda
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
78
scp-action/README.md
Normal file
78
scp-action/README.md
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
# SCP ACTION
|
||||||
|
***By `SRUEDA99`***
|
||||||
|
|
||||||
|
Forked by `shockrah` with minor improvement in the `entrypoint.sh`
|
||||||
|
file for my own personal use.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This action to copy the files from your repository to a remote server using **SCP** (Secure Copy Protocol).
|
||||||
|
|
||||||
|
## How to use it
|
||||||
|
You must give:
|
||||||
|
- The `host` which is the public address or the public DNS of the destination server.
|
||||||
|
- The `username` that will be used in the remote server.
|
||||||
|
- The `destination` folder, where the content will be copied.
|
||||||
|
- The `password` for the user or the private `key` in case the connection is based on SSH keys.
|
||||||
|
|
||||||
|
Optional:
|
||||||
|
- The `origin` folder is set by default as __"./*"__ but you can also specify it.
|
||||||
|
- The `port` is set as **22** by default, you can also specify another one.
|
||||||
|
- The `passphrase` if necessary.
|
||||||
|
|
||||||
|
**IMPORTANT**
|
||||||
|
```
|
||||||
|
Use Github secrets to give these parameters.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
**With password**
|
||||||
|
```
|
||||||
|
name: copy using password
|
||||||
|
uses: srueda99/scp-action@v12
|
||||||
|
with:
|
||||||
|
port: 22
|
||||||
|
host: ${{ secrets.SERVER_ADDRESS }}
|
||||||
|
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
|
||||||
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
```
|
||||||
|
|
||||||
|
**With key**
|
||||||
|
```
|
||||||
|
name: copy using key
|
||||||
|
uses: srueda99/scp-action@v12
|
||||||
|
with:
|
||||||
|
port: 22
|
||||||
|
host: ${{ secrets.SERVER_ADDRESS }}
|
||||||
|
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
|
||||||
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
|
key: ${{ secrets.SERVER_KEY }}
|
||||||
|
```
|
||||||
|
|
||||||
|
**With origin folder**
|
||||||
|
```
|
||||||
|
name: copy using password
|
||||||
|
uses: srueda99/scp-action@v12
|
||||||
|
with:
|
||||||
|
port: 22
|
||||||
|
host: ${{ secrets.SERVER_ADDRESS }}
|
||||||
|
origin: "./*"
|
||||||
|
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
|
||||||
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
```
|
||||||
|
|
||||||
|
**With passphrase**
|
||||||
|
```
|
||||||
|
name: copy using key
|
||||||
|
uses: srueda99/scp-action@v12
|
||||||
|
with:
|
||||||
|
port: 22
|
||||||
|
host: ${{ secrets.SERVER_ADDRESS }}
|
||||||
|
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
|
||||||
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
|
key: ${{ secrets.SERVER_KEY }}
|
||||||
|
passphrase: ${{ secrets.SERVER_PASSPHRASE }}
|
||||||
|
```
|
||||||
|
|
||||||
|
_Enjoy it!_
|
||||||
39
scp-action/action.yml
Normal file
39
scp-action/action.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: 'SCP Deployment'
|
||||||
|
description: 'Copies the files from your repository to a remote host using SCP'
|
||||||
|
author: 'Sebastian Rueda'
|
||||||
|
inputs:
|
||||||
|
# $1
|
||||||
|
port:
|
||||||
|
description: 'Port for SCP'
|
||||||
|
default: 22
|
||||||
|
# $2
|
||||||
|
host:
|
||||||
|
description: 'IP Address or DNS of your target host'
|
||||||
|
# $3
|
||||||
|
origin:
|
||||||
|
description: 'Source route folder'
|
||||||
|
default: "./*"
|
||||||
|
# $4
|
||||||
|
destination:
|
||||||
|
description: 'Destination route folder'
|
||||||
|
# $5
|
||||||
|
username:
|
||||||
|
description: 'User for remote connection'
|
||||||
|
# $6
|
||||||
|
password:
|
||||||
|
description: 'Password for the user'
|
||||||
|
# $7
|
||||||
|
key:
|
||||||
|
description: 'Private SSH key'
|
||||||
|
# $8
|
||||||
|
passphrase:
|
||||||
|
description: 'Passphrase for SSH key'
|
||||||
|
outputs:
|
||||||
|
time:
|
||||||
|
description: 'Returns the time when the script ran'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
branding:
|
||||||
|
icon: 'send'
|
||||||
|
color: 'black'
|
||||||
21
scp-action/entrypoint.sh
Executable file
21
scp-action/entrypoint.sh
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh -l
|
||||||
|
|
||||||
|
# Checking if the key input is not empty
|
||||||
|
if [[ "$INPUT_KEY" ]]; then
|
||||||
|
# If it is not empty, it uses the key for the SCP
|
||||||
|
echo -e "${INPUT_KEY}" > key # Creates a file with the key content
|
||||||
|
chmod 400 key # Set the key as Read-Only
|
||||||
|
echo "Trying SCP process with SSH key"
|
||||||
|
# Runs the SCP command
|
||||||
|
scp -P $INPUT_PORT -o StrictHostKeyChecking=no -i key $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
||||||
|
else
|
||||||
|
# If the keyis empty, it uses the password for the SCP
|
||||||
|
echo "Trying SCP process with password"
|
||||||
|
# Runs the SCP command
|
||||||
|
sshpass -p $INPUT_PASSWORD scp -P $INPUT_PORT -o StrictHostKeyChecking=no -r $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
||||||
|
fi
|
||||||
|
time=$(date)
|
||||||
|
echo "-----------------------------"
|
||||||
|
echo "| Files copied successfully |"
|
||||||
|
echo "-----------------------------"
|
||||||
|
echo "::set-output name=time::$time"
|
||||||
6
selenium/Dockerfile
Normal file
6
selenium/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM selenium/standalone-firefox
|
||||||
|
|
||||||
|
RUN sudo apt update && \
|
||||||
|
sudo apt install -y python3-pip python3-venv && \
|
||||||
|
sudo apt-get clean && sudo rm -rf /var/cache/apt/archives /var/lib/apt/lists
|
||||||
|
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
FROM debian:sid-slim
|
FROM gitea/runner-images:ubuntu-latest
|
||||||
MAINTAINER Alejandro Santillana alejandros714@protonmail.com
|
RUN wget https://github.com/gohugoio/hugo/releases/download/v0.135.0/hugo_0.135.0_linux-amd64.deb && \
|
||||||
|
apt-get install -y ./hugo_0.135.0_linux-amd64.deb && \
|
||||||
# For building and deploying to the VPS's and neocities
|
rm -rf var/lib/{apt,dpkg,cache,log} hugo_0.135.0_linux-arm64.deb
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y pandoc hugo curl --no-install-recommends && \
|
|
||||||
rm -rf var/lib/{apt,dpkg,cache,log}/
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user