Test action
Some checks failed
build-and-pudh / docker (push) Failing after 28s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s

This commit is contained in:
dobiadi
2024-10-23 22:04:55 +02:00
parent 1aa105908c
commit cf69376c5f
2 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
name: build-and-pudh
on:
push:
branches:
- master
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Get registry name
id: registry
run: echo "registry=$(echo $GITHUB_SERVER_URL | grep -oP 'https://\K\S+')" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.registry.outputs.registry }}/${{ gitea.repository }}
tags: |
type=sha,format=short,prefix=
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ steps.registry.outputs.registry }}
username: ${{ gitea.actor }}
password: ${{ secrets.CI_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}

View File

@@ -1,5 +1,5 @@
ARG ALPINE_VERSION=latest ARG ALPINE_VERSION=latest
FROM alpine:$ALPINE_VERSION as builder FROM alpine:$ALPINE_VERSION AS builder
COPY Cargo.lock /usr/src/ COPY Cargo.lock /usr/src/
COPY Cargo.toml /usr/src/ COPY Cargo.toml /usr/src/