From 720b635309868b5df75884312d87d034c710b3e1 Mon Sep 17 00:00:00 2001 From: d34dscene Date: Thu, 3 Oct 2024 13:22:05 +0200 Subject: [PATCH] test pipeline --- .github/workflows/docker-build.yml | 137 +++++++++++++++-------------- .woodpecker/build.yaml | 32 +++++++ 2 files changed, 101 insertions(+), 68 deletions(-) create mode 100644 .woodpecker/build.yaml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 05156c3..b159a37 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,68 +1,69 @@ -name: Docker Build - -on: - push: - branches: - - main - tags: - - 'v*' - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - attestations: write - id-token: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Install dependencies - run: | - cd web - npm install - npm run build - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/${{ github.repository }} - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=semver,pattern={{version}} - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} +# Disable for now +# name: Docker Build +# +# on: +# push: +# branches: +# - main +# tags: +# - 'v*' +# pull_request: +# branches: +# - main +# +# jobs: +# build: +# runs-on: ubuntu-latest +# +# permissions: +# contents: read +# packages: write +# attestations: write +# id-token: write +# +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Set up Node +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v3 +# +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# +# - name: Install dependencies +# run: | +# cd web +# npm install +# npm run build +# +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# registry: ghcr.io +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Extract metadata (tags, labels) for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ghcr.io/${{ github.repository }} +# tags: | +# type=raw,value=latest,enable={{is_default_branch}} +# type=semver,pattern={{version}} +# +# - name: Build and push +# uses: docker/build-push-action@v6 +# with: +# context: . +# platforms: linux/amd64 +# push: ${{ github.event_name != 'pull_request' }} +# tags: ${{ steps.meta.outputs.tags }} +# labels: ${{ steps.meta.outputs.labels }} diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..ab72786 --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,32 @@ +when: + - event: [push, tag, deployment] + branch: main + +steps: + - name: frontend-build + image: node:20 + commands: + - corepack enable + - corepack prepare pnpm@latest --activate + - pnpm config set store-dir .pnpm-store + - cd web + - pnpm install + - pnpm build + + - name: backend-audit + image: golang:latest + commands: + - go fmt ./... + - go vet ./... + - go mod tidy + - go mod verify + - go test ./... + + - name: container-build + image: woodpeckerci/plugin-docker-buildx + settings: + repo: ghcr.io/${CI_REPO_OWNER}/${CI_REPO_NAME} + platforms: linux/amd64, linux/arm64 + username: ${CI_REPO_OWNER} + password: + from_secret: ghcr_password