impl: ci
All checks were successful
docker / docker (push) Successful in 21s

This commit is contained in:
anna 2024-02-07 17:54:22 +00:00
parent 1a99aab121
commit 0cc71b6bb3

55
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: docker
on:
release:
types: [published]
pull_request:
push:
workflow_dispatch:
env:
REGISTRY: git.devminer.xyz
IMAGE_NAME: "${{ github.actor }}/publii-testing"
jobs:
docker:
runs-on: ubuntu-22.04
steps:
# - run: curl -fsSL https://get.docker.com | sh
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
labels: |
cache-from=type=local,src=/tmp/.buildx-cache
cache-to=type=local,dest=/tmp/.buildx-cache
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PASSWORD }}
- id: get_commit
run: echo ::set-output "name=hash::${GITHUB_SHA:0:7}"
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache