fix: GitHub Actions: use podman instead
This commit is contained in:
parent
a193dee410
commit
7039d881e3
44
.github/workflows/container.yml
vendored
Normal file
44
.github/workflows/container.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
name: Build Container Image
|
||||
on: [ push ]
|
||||
jobs:
|
||||
image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# reference: https://github.com/containers/podman/discussions/17868
|
||||
- name: Tar as root
|
||||
run: |
|
||||
sudo mv -fv /usr/bin/tar /usr/bin/tar.orig
|
||||
echo -e '#!/bin/sh\n\nsudo /usr/bin/tar.orig "$@"' | sudo tee -a /usr/bin/tar
|
||||
sudo chmod +x /usr/bin/tar
|
||||
- name: Enable caching for podman-machine
|
||||
- name: Cache Podman
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.local/share/containers
|
||||
~/.config/containers
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/*.Dockerfile', 'build_image.sh', 'VERSION') }}
|
||||
- name: Login to Container Registry
|
||||
uses: redhat-actions/podman-login@v1
|
||||
with:
|
||||
registry: git.0x7f.app
|
||||
username: ${{ secrets.CONTAINER_USERNAME }}
|
||||
password: ${{ secrets.CONTAINER_PASSWORD }}
|
||||
- name: Write Sentry DSN
|
||||
run: echo -n "$SENTRY_DSN" > dsn.txt
|
||||
env:
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
- name: Build Base Image
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: ./build_image.sh base
|
||||
env:
|
||||
DOCKER: podman
|
||||
- name: Build Server Image
|
||||
run: ./build_image.sh server
|
||||
env:
|
||||
DOCKER: podman
|
||||
- name: Build Runner Image
|
||||
run: ./build_image.sh runner
|
||||
env:
|
||||
DOCKER: podman
|
30
.github/workflows/docker.yml
vendored
30
.github/workflows/docker.yml
vendored
@ -1,30 +0,0 @@
|
||||
name: Build Docker Image
|
||||
on: [ push ]
|
||||
jobs:
|
||||
image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Login to Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.0x7f.app
|
||||
username: ${{ secrets.CONTAINER_USERNAME }}
|
||||
password: ${{ secrets.CONTAINER_PASSWORD }}
|
||||
- name: Write Sentry DSN
|
||||
run: echo -n "$SENTRY_DSN" > dsn.txt
|
||||
env:
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
- name: Build Base Image
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: ./build_image.sh base
|
||||
env:
|
||||
DOCKER: docker
|
||||
- name: Build Server Image
|
||||
run: ./build_image.sh server
|
||||
env:
|
||||
DOCKER: docker
|
||||
- name: Build Runner Image
|
||||
run: ./build_image.sh runner
|
||||
env:
|
||||
DOCKER: docker
|
@ -6,7 +6,7 @@ ENV CGO_ENABLED=0
|
||||
WORKDIR /builder
|
||||
|
||||
RUN apk add --no-cache git make
|
||||
RUN --mount=type=cache,id=golang,target=/go/pkg go install github.com/swaggo/swag/cmd/swag@latest
|
||||
RUN go install github.com/swaggo/swag/cmd/swag@latest
|
||||
|
||||
ARG IMAGE_PREFIX=git.0x7f.app/woj
|
||||
ENV CONTAINER_IMAGE_FULL=${IMAGE_PREFIX}/ubuntu-full:latest
|
||||
@ -14,10 +14,10 @@ ENV CONTAINER_IMAGE_RUN=${IMAGE_PREFIX}/ubuntu-run:latest
|
||||
|
||||
COPY go.mod /builder/go.mod
|
||||
COPY go.sum /builder/go.sum
|
||||
RUN --mount=type=cache,id=golang,target=/go/pkg go mod download
|
||||
RUN go mod download
|
||||
|
||||
COPY . /builder
|
||||
RUN --mount=type=cache,id=golang,target=/go/pkg make build
|
||||
RUN make build
|
||||
|
||||
|
||||
# main image
|
||||
|
@ -6,14 +6,14 @@ ENV CGO_ENABLED=0
|
||||
WORKDIR /builder
|
||||
|
||||
RUN apk add --no-cache git make
|
||||
RUN --mount=type=cache,id=golang,target=/go/pkg go install github.com/swaggo/swag/cmd/swag@latest
|
||||
RUN go install github.com/swaggo/swag/cmd/swag@latest
|
||||
|
||||
COPY go.mod /builder/go.mod
|
||||
COPY go.sum /builder/go.sum
|
||||
RUN --mount=type=cache,id=golang,target=/go/pkg go mod download
|
||||
RUN go mod download
|
||||
|
||||
COPY . /builder
|
||||
RUN --mount=type=cache,id=golang,target=/go/pkg make build
|
||||
RUN make build
|
||||
|
||||
# UI Builder
|
||||
FROM git.0x7f.app/woj/woj-ui:1.1.0 AS ui-builder
|
||||
|
Loading…
Reference in New Issue
Block a user