From cd22dc20d2aafcf7ac50845ec3cd4579006316d1 Mon Sep 17 00:00:00 2001 From: psyko-gh Date: Sat, 24 Aug 2024 14:50:54 +0200 Subject: [PATCH] build: updated Github actions --- .../workflows/{ci.yaml => contribution.yaml} | 26 +---------- .github/workflows/edge.yaml | 38 ++++++++++++++++ .github/workflows/release-docker.yaml | 43 +++++++++++++++++++ .github/workflows/release.yaml | 31 +++++++++++++ 4 files changed, 113 insertions(+), 25 deletions(-) rename .github/workflows/{ci.yaml => contribution.yaml} (52%) create mode 100644 .github/workflows/edge.yaml create mode 100644 .github/workflows/release-docker.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/contribution.yaml similarity index 52% rename from .github/workflows/ci.yaml rename to .github/workflows/contribution.yaml index e4dbbaf..ee523cd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/contribution.yaml @@ -1,12 +1,9 @@ -name: CI Overcrawlrr +name: Contribution on: pull_request: branches: - '*' - push: - branches: - - master jobs: check: @@ -39,24 +36,3 @@ jobs: status: ${{ job.status }} token: ${{ secrets.GITHUB_TOKEN }} sha: ${{ github.sha }} - - build_and_push: - name: Build & publish Docker image - if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]') - runs-on: ubuntu-latest - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: true - tags: psyko/overcrawlrr:develop diff --git a/.github/workflows/edge.yaml b/.github/workflows/edge.yaml new file mode 100644 index 0000000..59e7060 --- /dev/null +++ b/.github/workflows/edge.yaml @@ -0,0 +1,38 @@ +name: Contribution + +on: + push: + branches: + - master + +jobs: + build_and_push: + name: Build & publish Docker image + if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]') + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=edge + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml new file mode 100644 index 0000000..85984d9 --- /dev/null +++ b/.github/workflows/release-docker.yaml @@ -0,0 +1,43 @@ +name: Overcrawlrr Release Docker Image + +on: + push: + tags: + - 'v*' + +jobs: + semantic-release: + name: Tag and release latest version + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + issues: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=semver,pattern={{version}} + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..37e1d3b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,31 @@ +name: Overcrawlrr Release + +on: + push: + branches: + - release + +jobs: + semantic-release: + name: Tag and release latest version + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + issues: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '>=20.8.1' + - name: Install dependencies + run: npm ci + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release