-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 12bc0f4
Showing
6 changed files
with
986 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
Oops, something went wrong.