Skip to content

Commit 12bc0f4

Browse files
committed
feat: Initial commit
0 parents  commit 12bc0f4

File tree

6 files changed

+986
-0
lines changed

6 files changed

+986
-0
lines changed

.github/workflows/do-nuke.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Nuke DigitalOcean Resources
2+
3+
on:
4+
# schedule:
5+
# - cron: '33 3 * * *'
6+
workflow_dispatch:
7+
inputs:
8+
input:
9+
description: "Manual Execution"
10+
required: true
11+
default: "Manual Execution"
12+
13+
jobs:
14+
Execution:
15+
runs-on: ubuntu-22.04
16+
defaults:
17+
run:
18+
working-directory: ./scripts
19+
20+
steps:
21+
- name: Setup DigitalOcean doctl
22+
uses: digitalocean/action-doctl@v2
23+
with:
24+
token: ${{ secrets.DO_TOKEN }}
25+
26+
- name: Check out the repository
27+
uses: actions/checkout@v4
28+
29+
- name: Make the script file executable
30+
run: chmod +x cyber-do.sh
31+
- name: Run the script
32+
run: |
33+
./cyber-do.sh
34+
env:
35+
DO_CLI_TOKEN: ${{ secrets.DO_TOKEN }}
36+

.github/workflows/hadolint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint Dockerfile
2+
3+
on:
4+
push:
5+
paths:
6+
- 'Dockerfile'
7+
workflow_dispatch:
8+
inputs:
9+
input:
10+
description: "Manual Execution"
11+
required: true
12+
default: "Manual Execution"
13+
14+
jobs:
15+
Lint:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Lint Dockerfile
21+
uses: hadolint/hadolint-action@master
22+
with:
23+
dockerfile: "Dockerfile"
24+
failure-threshold: error
25+
format: json

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM alpine:3.20
2+
3+
WORKDIR /home
4+
COPY ./scripts /home
5+
6+
ENV DO_CLI_TOKEN=<your-personal-access-token-here>
7+
8+
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
9+
RUN apk update \
10+
&& apk add bash=5.2.26-r0 --no-cache \
11+
&& wget -q https://api.github.com/repos/digitalocean/doctl/releases/latest -O - \
12+
| grep -E "browser_download.*linux-amd64" \
13+
| awk -F '[""]' '{print $4}' \
14+
| xargs wget -q -P /tmp/ \
15+
&& tar xf /tmp/doctl*.tar.gz -C /tmp \
16+
&& mv /tmp/doctl /usr/local/bin \
17+
&& chmod +x /home/cyber-do.sh \
18+
&& doctl auth init --access-token ${DO_CLI_TOKEN} \
19+
20+
ENTRYPOINT ["/bin/bash"]
21+
CMD ["bash", "./cyber-do.sh"]

0 commit comments

Comments
 (0)