Skip to content

Commit acb28a1

Browse files
committed
First commit
0 parents  commit acb28a1

8 files changed

Lines changed: 173 additions & 0 deletions

File tree

.github/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
dockerfile:
2+
- any: ["Dockerfile"]
3+
4+
entrypoint:
5+
- any: ["entryopint"]
6+
7+
GithubActions:
8+
- any:
9+
[
10+
".github/*",
11+
".github/workflows/*",
12+
".github/workflows/**/*",
13+
".github/**/*",
14+
]

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Descrição
2+
3+
Provide a high-level description of what this PR does.
4+
5+
**Ticket Details**
6+
7+
https://imakecodes.atlassian.net/browse/ABC-123

.github/release-drafter.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
categories:
4+
- title: "🚀 Novidades"
5+
label: "feature"
6+
- title: "🛠 Manutenção"
7+
label: "maintenance"
8+
- title: "🐛 Bug Fixes"
9+
label: "bug"
10+
version-resolver:
11+
major:
12+
labels:
13+
- "major"
14+
minor:
15+
labels:
16+
- "feature"
17+
patch:
18+
labels:
19+
- "maintenance"
20+
- "bug"
21+
default: patch
22+
replacers:
23+
- search: '/([A-Z]{2,5}-\d{1,6})/g'
24+
replace: "[$1](https://imakecodes.atlassian.net/browse/$1)"
25+
autolabeler:
26+
- label: "maintenance"
27+
title:
28+
- "/^chore.+/i"
29+
- label: "bug"
30+
title:
31+
- "/^fix.+/i"
32+
- label: "feature"
33+
title:
34+
- "/^feat.+/i"
35+
- label: "major"
36+
title:
37+
- '/^[a-zA-Z]+(\(.*?\))?!:.+/i'
38+
template: |
39+
## O que há de novo?
40+
$CHANGES

.github/workflows/labeler.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
pull_request:
4+
# types of events to trigger the workflow; optional, defaults to all
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
triage:
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/labeler@v4
15+
with:
16+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/on_release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Creates a docker image for production
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build_docker:
10+
name: Build the docker image
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 1
17+
- name: Log in to Docker Hub
18+
uses: docker/login-action@v2
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
22+
- name: Extract metadata (tags, labels) for Docker
23+
id: meta
24+
uses: docker/metadata-action@v4
25+
with:
26+
images: redbeard/dev-tunnel
27+
- name: Build and push Docker image
28+
uses: docker/build-push-action@v4
29+
with:
30+
context: .
31+
no-cache: true
32+
push: true
33+
tags: ${{ steps.meta.outputs.tags }}
34+
labels: ${{ steps.meta.outputs.labels }}
35+
# deploy:
36+
# name: Deploy
37+
# runs-on: ubuntu-latest
38+
# needs:
39+
# - build_docker
40+
# steps:
41+
# - name: Checkout
42+
# uses: actions/checkout@v4
43+
# with:
44+
# fetch-depth: 1
45+
# - name: Curl -XPOST URL
46+
# run: curl -XPOST https://api.redbeard.dev/webhooks/deploy
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Release Drafter
2+
on:
3+
push:
4+
# branches to consider in the event; optional, defaults to all
5+
branches:
6+
- main
7+
jobs:
8+
update_release_draft:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: release-drafter/release-drafter@v5
12+
with:
13+
disable-autolabeler: true
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use Ubuntu as the base image
2+
FROM ubuntu:latest AS runner
3+
4+
# Install SSH Server
5+
RUN apt-get update && \
6+
apt-get install -y openssh-server && \
7+
rm -rf /var/lib/apt/lists/*
8+
9+
# Create a user (e.g., 'dev') and set the password
10+
RUN useradd -rm -d /home/dev -s /bin/bash -g root -G sudo -u 1001 dev
11+
12+
# SSH login fix. Otherwise, the user is kicked off after login
13+
RUN mkdir /var/run/sshd
14+
15+
# Change SSH settings to allow port forwarding
16+
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
17+
sed -i 's/#AllowTcpForwarding no/AllowTcpForwarding yes/' /etc/ssh/sshd_config && \
18+
sed -i 's/#PermitTunnel no/PermitTunnel yes/' /etc/ssh/sshd_config
19+
20+
COPY entrypoint.sh /entrypoint.sh
21+
RUN chmod +x /entrypoint.sh
22+
23+
# Expose the SSH port
24+
EXPOSE 22
25+
26+
# Run the SSH server
27+
ENTRYPOINT [ "/entrypoint.sh" ]

entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
echo "Setting SSH password"
4+
echo "dev:${DEV_TUNNEL_SSH_PASSWORD}" | chpasswd
5+
6+
# Start SSH service
7+
echo "Starting SSH service"
8+
/usr/sbin/sshd -D

0 commit comments

Comments
 (0)