This commit is contained in:
parent
0555337480
commit
9b57184dff
2 changed files with 41 additions and 18 deletions
|
@ -31,13 +31,6 @@ jobs:
|
|||
# Optional: Commit-SHA für alle Events
|
||||
type=sha,prefix=sha-
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ steps.repository.outputs.registry }}
|
||||
username: ${{ secrets.PACKAGES_USER }}
|
||||
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
|
@ -47,16 +40,44 @@ jobs:
|
|||
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
||||
driver-opts: network=host
|
||||
|
||||
- name: Build and push
|
||||
- name: Build Docker Image
|
||||
uses: docker/build-push-action@v6
|
||||
id: build
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
allow: network.host
|
||||
network: host
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.docker.outputs.tags }}
|
||||
outputs: type=docker
|
||||
no-cache: false
|
||||
|
||||
- name: Run Tests in Docker Image
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v $(pwd):/app \
|
||||
-w /app \
|
||||
${{ steps.docker.outputs.tags | split('\n') | first }} \
|
||||
go test ./... -v
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ steps.repository.outputs.registry }}
|
||||
username: ${{ secrets.PACKAGES_USER }}
|
||||
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||
|
||||
- name: Push Docker Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
allow: network.host
|
||||
network: host
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.docker.outputs.tags }}
|
||||
|
||||
|
||||
no-cache: false
|
||||
|
||||
# name: CI/CD Pipeline
|
||||
# on: push
|
||||
|
@ -100,14 +121,14 @@ jobs:
|
|||
# push: true
|
||||
# tags: ${{ env.GITHUB_SERVER_URL }}/${{ secret.GITHUB_REPOSITORY_OWNER }}/loic:${{ github.sha }}
|
||||
|
||||
# - name: Set up Go
|
||||
# uses: actions/setup-go@v3
|
||||
# with:
|
||||
# go-version: '1.24'
|
||||
# - name: Build Go Binary
|
||||
# run: go mod tidy && go build -o loic
|
||||
# - name: Test Go Binary
|
||||
# run: go test
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.24'
|
||||
- name: Build Go Binary
|
||||
run: go mod tidy && go build -o loic
|
||||
- name: Test Go Binary
|
||||
run: go test
|
||||
# - name: Debug Variables
|
||||
# run: |
|
||||
# env
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
FROM golang:1.24 AS builder
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o loic .
|
||||
RUN ls -l /app/loic
|
||||
|
|
Loading…
Reference in a new issue