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
|
# Optional: Commit-SHA für alle Events
|
||||||
type=sha,prefix=sha-
|
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
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
@ -47,16 +40,44 @@ jobs:
|
||||||
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
||||||
driver-opts: 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
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
|
context: .
|
||||||
push: true
|
push: true
|
||||||
allow: network.host
|
allow: network.host
|
||||||
network: host
|
network: host
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: ${{ steps.docker.outputs.tags }}
|
tags: ${{ steps.docker.outputs.tags }}
|
||||||
|
no-cache: false
|
||||||
|
|
||||||
|
|
||||||
# name: CI/CD Pipeline
|
# name: CI/CD Pipeline
|
||||||
# on: push
|
# on: push
|
||||||
|
@ -100,14 +121,14 @@ jobs:
|
||||||
# push: true
|
# push: true
|
||||||
# tags: ${{ env.GITHUB_SERVER_URL }}/${{ secret.GITHUB_REPOSITORY_OWNER }}/loic:${{ github.sha }}
|
# tags: ${{ env.GITHUB_SERVER_URL }}/${{ secret.GITHUB_REPOSITORY_OWNER }}/loic:${{ github.sha }}
|
||||||
|
|
||||||
# - name: Set up Go
|
- name: Set up Go
|
||||||
# uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
# with:
|
with:
|
||||||
# go-version: '1.24'
|
go-version: '1.24'
|
||||||
# - name: Build Go Binary
|
- name: Build Go Binary
|
||||||
# run: go mod tidy && go build -o loic
|
run: go mod tidy && go build -o loic
|
||||||
# - name: Test Go Binary
|
- name: Test Go Binary
|
||||||
# run: go test
|
run: go test
|
||||||
# - name: Debug Variables
|
# - name: Debug Variables
|
||||||
# run: |
|
# run: |
|
||||||
# env
|
# env
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
FROM golang:1.24 AS builder
|
FROM golang:1.24 AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o loic .
|
RUN CGO_ENABLED=0 GOOS=linux go build -o loic .
|
||||||
RUN ls -l /app/loic
|
RUN ls -l /app/loic
|
||||||
|
|
Loading…
Reference in a new issue