Do
This commit is contained in:
30
.gitea/workflows/work.yaml
Normal file
30
.gitea/workflows/work.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: Build and push container image
|
||||||
|
run-name: ${{ gitea.actor }} is building and pushing container image
|
||||||
|
on: create
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITEA_DOMAIN: git.tesseslanguage.com
|
||||||
|
GITEA_REGISTRY_USER: tesses50
|
||||||
|
RESULT_IMAGE_NAME: tesses50/test-app
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Log in to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.GITEA_DOMAIN }}
|
||||||
|
username: ${{ env.GITEA_REGISTRY_USER }}
|
||||||
|
password: ${{ secrets. }}
|
||||||
|
- name: Build and push image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ env.GITEA_DOMAIN }}/${{ env.RESULT_IMAGE_NAME }}:${{ gitea.ref }}
|
||||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM ubuntu:latest AS builder
|
||||||
|
WORKDIR /src
|
||||||
|
RUN apt update -y && apt install -y gcc
|
||||||
|
|
||||||
|
COPY main.c main.c
|
||||||
|
RUN gcc -o main main.c
|
||||||
|
|
||||||
|
FROM ubuntu:latest
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /src/main /usr/local/bin/main
|
||||||
|
|
||||||
Reference in New Issue
Block a user