Skip to content

Commit

Permalink
feat: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ciro-mota committed Jun 1, 2024
0 parents commit 12bc0f4
Show file tree
Hide file tree
Showing 6 changed files with 986 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/do-nuke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Nuke DigitalOcean Resources

on:
# schedule:
# - cron: '33 3 * * *'
workflow_dispatch:
inputs:
input:
description: "Manual Execution"
required: true
default: "Manual Execution"

jobs:
Execution:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./scripts

steps:
- name: Setup DigitalOcean doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_TOKEN }}

- name: Check out the repository
uses: actions/checkout@v4

- name: Make the script file executable
run: chmod +x cyber-do.sh
- name: Run the script
run: |
./cyber-do.sh
env:
DO_CLI_TOKEN: ${{ secrets.DO_TOKEN }}

25 changes: 25 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint Dockerfile

on:
push:
paths:
- 'Dockerfile'
workflow_dispatch:
inputs:
input:
description: "Manual Execution"
required: true
default: "Manual Execution"

jobs:
Lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Lint Dockerfile
uses: hadolint/hadolint-action@master
with:
dockerfile: "Dockerfile"
failure-threshold: error
format: json
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM alpine:3.20

WORKDIR /home
COPY ./scripts /home

ENV DO_CLI_TOKEN=<your-personal-access-token-here>

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN apk update \
&& apk add bash=5.2.26-r0 --no-cache \
&& wget -q https://api.github.com/repos/digitalocean/doctl/releases/latest -O - \
| grep -E "browser_download.*linux-amd64" \
| awk -F '[""]' '{print $4}' \
| xargs wget -q -P /tmp/ \
&& tar xf /tmp/doctl*.tar.gz -C /tmp \
&& mv /tmp/doctl /usr/local/bin \
&& chmod +x /home/cyber-do.sh \
&& doctl auth init --access-token ${DO_CLI_TOKEN} \

ENTRYPOINT ["/bin/bash"]
CMD ["bash", "./cyber-do.sh"]
Loading

0 comments on commit 12bc0f4

Please sign in to comment.