diff --git a/.github/workflows/infradocs.yml b/.github/workflows/infradocs.yml index 1b834da7..b4e15a6a 100644 --- a/.github/workflows/infradocs.yml +++ b/.github/workflows/infradocs.yml @@ -1,34 +1,54 @@ name: infradocs on: + pull_request: + paths: + - docs/** push: branches: - master paths: - - 'docs/**' + - docs/** jobs: - main: + build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Checkout repo + uses: classabbyamp/treeless-checkout-action@v1 + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 with: - submodules: false + images: | + ghcr.io/${{ github.repository_owner }}/infradocs + tags: | + type=sha,prefix= + type=raw,value=latest,enable={{is_default_branch}} + flavor: latest=false + labels: | + org.opencontainers.image.authors=Void Linux team and contributors + org.opencontainers.image.url=https://voidlinux.org + org.opencontainers.image.documentation=https://infradocs.voidlinux.org + org.opencontainers.image.source=https://github.com/${{ github.repository }} + org.opencontainers.image.vendor=Void Linux + org.opencontainers.image.title=Void Linux infrastructure documentation + org.opencontainers.image.description=infrastructure documentation image for Void Linux - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GCHR - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io - username: void-robot - password: ${{ secrets.CR_PAT }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: - push: true - tags: "ghcr.io/void-linux/infradocs:${{github.sha}}" context: docs + push: ${{ endsWith(github.ref, 'master') }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/pkg-alps.yml b/.github/workflows/pkg-alps.yml index 8d2e42b0..80aae03d 100644 --- a/.github/workflows/pkg-alps.yml +++ b/.github/workflows/pkg-alps.yml @@ -1,35 +1,22 @@ name: alps Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/alps/** + push: + branches: + - master + paths: + - services/pkg/alps/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/alps - push: true - tags: "ghcr.io/void-linux/infra-alps:${{ github.event.inputs.version }}" - build-args: | - ALPS_REV=${{ github.event.inputs.version }} - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: alps + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-lego.yml b/.github/workflows/pkg-lego.yml index 98f610ae..95d95688 100644 --- a/.github/workflows/pkg-lego.yml +++ b/.github/workflows/pkg-lego.yml @@ -1,33 +1,22 @@ name: LEGO Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/lego/** + push: + branches: + - master + paths: + - services/pkg/lego/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/lego - push: true - tags: "ghcr.io/void-linux/infra-lego:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: lego + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-man-cgi.yml b/.github/workflows/pkg-man-cgi.yml index 9984ce4f..8c021753 100644 --- a/.github/workflows/pkg-man-cgi.yml +++ b/.github/workflows/pkg-man-cgi.yml @@ -1,33 +1,22 @@ name: man-cgi Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/man-cgi/** + push: + branches: + - master + paths: + - services/pkg/man-cgi/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/man-cgi - push: true - tags: "ghcr.io/void-linux/infra-man-cgi:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: man-cgi + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-nginx.yml b/.github/workflows/pkg-nginx.yml index 0a69c3aa..4d7eb0aa 100644 --- a/.github/workflows/pkg-nginx.yml +++ b/.github/workflows/pkg-nginx.yml @@ -1,33 +1,22 @@ name: NGINX Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/nginx/** + push: + branches: + - master + paths: + - services/pkg/nginx/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/nginx - push: true - tags: "ghcr.io/void-linux/infra-nginx:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: nginx + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-rspamd.yml b/.github/workflows/pkg-rspamd.yml index 390297d6..1768b504 100644 --- a/.github/workflows/pkg-rspamd.yml +++ b/.github/workflows/pkg-rspamd.yml @@ -1,33 +1,22 @@ name: rspamd Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/rspamd/** + push: + branches: + - master + paths: + - services/pkg/rspamd/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/rspamd - push: true - tags: "ghcr.io/void-linux/infra-rspamd:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: rspamd + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-rsync.yml b/.github/workflows/pkg-rsync.yml index 9232f9e5..2942bb76 100644 --- a/.github/workflows/pkg-rsync.yml +++ b/.github/workflows/pkg-rsync.yml @@ -1,33 +1,22 @@ name: RSync Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/rsync/** + push: + branches: + - master + paths: + - services/pkg/rsync/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/rsync - push: true - tags: "ghcr.io/void-linux/infra-rsync:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: rsync + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-sftpgo.yml b/.github/workflows/pkg-sftpgo.yml index cd069a8e..7e1a52ef 100644 --- a/.github/workflows/pkg-sftpgo.yml +++ b/.github/workflows/pkg-sftpgo.yml @@ -1,33 +1,22 @@ name: SFTPGo Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/sftpgo/** + push: + branches: + - master + paths: + - services/pkg/sftpgo/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/sftpgo - push: true - tags: "ghcr.io/void-linux/infra-sftpgo:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: sftpgo + push: ${{ endsWith(github.ref, 'master') }} diff --git a/.github/workflows/pkg-xmandump.yml b/.github/workflows/pkg-xmandump.yml index 84a470b5..a55d34e4 100644 --- a/.github/workflows/pkg-xmandump.yml +++ b/.github/workflows/pkg-xmandump.yml @@ -1,33 +1,22 @@ name: xmandump Service Container on: workflow_dispatch: - inputs: - version: - description: "Version tag" - required: true + pull_request: + paths: + - services/pkg/xmandump/** + push: + branches: + - master + paths: + - services/pkg/xmandump/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@master - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GCHR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: services/pkg/xmandump - push: true - tags: "ghcr.io/void-linux/infra-xmandump:${{ github.event.inputs.version }}" - labels: | - org.opencontainers.image.source=${{ github.repositoryUrl }} + uses: ./.github/workflows/pkg-build.yml + with: + service_name: xmandump + push: ${{ endsWith(github.ref, 'master') }}