From 03b3217e82606b4be2e2a74652419d03fdb8e7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=E1=BA=A1nh=20T=C6=B0=E1=BB=9Dng=20Solo?= <41409442+vncloudsco@users.noreply.github.com> Date: Sun, 15 Sep 2024 00:14:33 +0700 Subject: [PATCH] docker --- .github/workflows/docker-image.yml | 30 ++++++++++++++ .github/workflows/insert-checklist.yml | 50 ----------------------- .github/workflows/insert-contributors.yml | 38 ----------------- .github/workflows/maintain-gh-pages.yml | 45 -------------------- .github/workflows/sync-mirror.yml | 17 -------- 5 files changed, 30 insertions(+), 150 deletions(-) create mode 100644 .github/workflows/docker-image.yml delete mode 100644 .github/workflows/insert-checklist.yml delete mode 100644 .github/workflows/insert-contributors.yml delete mode 100644 .github/workflows/maintain-gh-pages.yml delete mode 100644 .github/workflows/sync-mirror.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..91473d2 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,30 @@ +name: Docker Build and Push + +on: + push: + branches: + - master + +jobs: + build_and_push: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build and Push Docker Image for personal-security-checklist + run: | + docker buildx create --use + echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + docker build -t vouu/personal-security-checklist:14-09-2024 . --push + docker build -t vouu/personal-security-checklist . --push \ No newline at end of file diff --git a/.github/workflows/insert-checklist.yml b/.github/workflows/insert-checklist.yml deleted file mode 100644 index c61fc8c..0000000 --- a/.github/workflows/insert-checklist.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: โ˜‘๏ธ Generate and insert markdown from YAML - -on: - workflow_dispatch: - push: - branches: [ master ] - paths: ['personal-security-checklist.yml'] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository ๐Ÿ›Ž๏ธ - uses: actions/checkout@v2 - - # Get current date-time (used for commit message) - - name: Get Date ๐Ÿ“… - id: date - run: echo "::set-output name=date::$(date +'%d-%b-%Y')" - - # Downloads + installs Python (used for running gen scripts) - - name: Set up Python ๐Ÿ - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - # Install contents of requirements.txt - - name: Install dependencies ๐Ÿ“ฅ - run: | - python -m pip install --upgrade pip - cd lib && pip install -r requirements.txt - - # The make command triggers all the Python scripts, generates output - - name: Run make command ๐Ÿ”จ - run: python lib/generate.py - - # Commit and push the outputed JSON files - - name: Commit and push generated files โคด๏ธ - run: | - git config --global user.name "Liss-Bot" - git config --global user.email "alicia-gh-bot@mail.as93.net" - git pull origin master - git add CHECKLIST.md - if git diff --staged --quiet; then - echo "Nothin new added, so nothing to commit, exiting..." - else - git commit -m "Updates checklist (auto-generated, on ${{ steps.date.outputs.date }})" - git push - fi diff --git a/.github/workflows/insert-contributors.yml b/.github/workflows/insert-contributors.yml deleted file mode 100644 index 596886c..0000000 --- a/.github/workflows/insert-contributors.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Inserts list of community members into ./README.md -name: ๐Ÿ’“ Inserts Contributors & Sponsors -on: - workflow_dispatch: # Manual dispatch - schedule: - - cron: '45 1 * * 0' # At 01:45 on Sunday. - -jobs: - # Job #1 - Fetches sponsors and inserts table into readme - insert-sponsors: - runs-on: ubuntu-latest - name: Inserts Sponsors ๐Ÿ’“ - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Updates readme with sponsors - uses: JamesIves/github-sponsors-readme-action@1.0.5 - with: - token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - file: .github/README.md - - # Job #2 - Fetches contributors and inserts table into readme - insert-contributors: - runs-on: ubuntu-latest - name: Inserts Contributors ๐Ÿ’“ - steps: - - name: Updates readme with contributors - uses: akhilmhdh/contributors-readme-action@v2.3.4 - env: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - with: - image_size: 80 - readme_path: .github/README.md - columns_per_row: 6 - commit_message: 'docs: Updates contributors list' - committer_username: liss-bot - committer_email: liss-bot@d0h.co - \ No newline at end of file diff --git a/.github/workflows/maintain-gh-pages.yml b/.github/workflows/maintain-gh-pages.yml deleted file mode 100644 index 1a1bb33..0000000 --- a/.github/workflows/maintain-gh-pages.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: ๐Ÿ™ Update gh-pages site - -on: - workflow_dispatch: # Manual dispatch - push: - branches: [ master ] - paths: ['CHECKLIST.md'] - -jobs: - update-readme: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Configure git - run: | - git config --global user.email "liss-bot@d0h.co" - git config --global user.name "Liss.Bot" - - - name: Copy CHECKLIST.md to gh-pages - run: | - # Fetch all branches - git fetch --all - - # Switch to gh-pages branch - git checkout gh-pages - - # Copy CHECKLIST from master branch - git checkout master -- CHECKLIST.md - - # Move and rename CHECKLIST.md to the root - mv CHECKLIST.md README.md - - # Check if there are changes, if so commit and push - if [ -n "$(git status --porcelain)" ]; then - git add README.md - git commit -m "Update README.md from master branch" - git push origin gh-pages - else - echo "No changes in README.md" - fi diff --git a/.github/workflows/sync-mirror.yml b/.github/workflows/sync-mirror.yml deleted file mode 100644 index 2bdb7c6..0000000 --- a/.github/workflows/sync-mirror.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Pushes the contents of the repo to the Codeberg mirror -name: ๐Ÿชž Mirror to Codeberg -on: - workflow_dispatch: - schedule: - - cron: '30 0 * * 0' -jobs: - codeberg: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: { fetch-depth: 0 } - - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: git@codeberg.org:alicia/personal-security-checklist.git - ssh_private_key: ${{ secrets.CODEBERG_SSH }} -