Skip to content

feat: update scripts #123

feat: update scripts

feat: update scripts #123

name: Build Docker Images (Ubuntu non-LTS)
on:
push:
branches:
- main
paths:
- 'build/ubuntu/non-lts/**'
- 'docker/**'
schedule:
- cron: '0 0 1 * *' # 每月第一天 08:00 执行任务(CST = UTC + 8:00)
workflow_dispatch:
jobs:
init-build-env:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get All Changed Files
id: step2
run: |
git fetch --depth=2
git diff --name-only "HEAD^" > /tmp/changed_files.txt
echo "changed_files=$(paste -sd "," /tmp/changed_files.txt)" >> "$GITHUB_OUTPUT"
cat /tmp/changed_files.txt
- name: Install Dependencies
run: bash ./setup.sh
- name: Compress Folder
run: zip -r /tmp/artifact.zip . -x ".git/*"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: env-artifact
path: /tmp/artifact.zip
outputs:
changed-files: ${{ steps.step2.outputs.changed_files }}
build-ubuntu1704:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/17.04')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/17.04/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-17.04
build-ubuntu1710:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/17.10')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/17.10/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-17.10
build-ubuntu1810:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/18.10')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/18.10/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-18.10
build-ubuntu1904:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/19.04')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/19.04/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-19.04
build-ubuntu1910:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/19.10')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/19.10/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-19.10
build-ubuntu2010:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/20.10')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/20.10/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-20.10
build-ubuntu2104:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/21.04')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/21.04/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-21.04
build-ubuntu2210:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/22.10')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/22.10/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-22.10
build-ubuntu2304:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/23.04')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/23.04/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-23.04
build-ubuntu2310:
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
contains(needs.init-build-env.outputs.changed-files, 'ubuntu/non-lts/23.10')
runs-on: ubuntu-latest
needs: [init-build-env]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: env-artifact
path: .
- name: Decompress Artifact
run: unzip artifact.zip -d .
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/ubuntu/non-lts/23.10/Dockerfile
push: true
tags: th3s/pwn-env:ubuntu-23.10