Compare commits
27 Commits
7827745c11
...
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 |
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,13 +0,0 @@
|
||||
name: Simple Docker Hello World Test
|
||||
run-name: Tester workflow
|
||||
on:
|
||||
- push
|
||||
|
||||
|
||||
jobs:
|
||||
hello-world:
|
||||
runs-on: gitea-main
|
||||
container:
|
||||
image: alpine
|
||||
steps:
|
||||
- run: echo "Target branch ${{ gitea.ref }}"
|
||||
@@ -1,16 +1,12 @@
|
||||
# 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
|
||||
|
||||
MAINTAINER shockrah :^)
|
||||
|
||||
RUN apk --update add sudo python3 openssl ca-certificates openssh-client rsync && \
|
||||
RUN apk --update add sudo python3 git openssl ca-certificates openssh-client rsync && \
|
||||
apk --update add --virtual build-dependencies \
|
||||
python3-dev libffi-dev openssl-dev build-base && \
|
||||
python3 -m ensurepip && \
|
||||
pip3 install --upgrade pip cffi && \
|
||||
pip3 install ansible && \
|
||||
python3-dev libffi-dev openssl-dev build-base \
|
||||
ansible py3-ansible-lint && \
|
||||
apk del build-dependencies && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
mkdir -p /etc/ansible && \
|
||||
@@ -20,5 +16,3 @@ RUN apk --update add sudo python3 openssl ca-certificates openssh-client rsync &
|
||||
CMD ["ansible-playbook", "--version"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ stages:
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
# Ensure we login to docker hub before hand everytime
|
||||
# Login to the docker registry to push
|
||||
before_script:
|
||||
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
||||
- 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
|
||||
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"
|
||||
@@ -1,6 +1,5 @@
|
||||
FROM debian:sid-slim
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends hugo && \
|
||||
rm -rf var/lib/{apt,dpkg,cache,log}/
|
||||
|
||||
FROM gitea/runner-images:ubuntu-latest
|
||||
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 && \
|
||||
rm -rf var/lib/{apt,dpkg,cache,log} hugo_0.135.0_linux-arm64.deb
|
||||
|
||||
|
||||
Reference in New Issue
Block a user