docker build workflow (attempt 1)
This commit is contained in:
parent
0304ec657a
commit
70d38fd5b7
50
.forgejo/workflows/docker-build.yml
Normal file
50
.forgejo/workflows/docker-build.yml
Normal file
|
@ -0,0 +1,50 @@
|
|||
name: Docker Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
tags:
|
||||
- "*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish_api:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: actions/docker-metadata-action@v4
|
||||
with:
|
||||
# list of Docker images to use as base name for tags
|
||||
images: git.amogus.cloud/lea/maddy-admin
|
||||
# generate Docker tags based on branch and short commit SHA
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=sha
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: actions/docker-setup-qemu-action@v2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: actions/docker-setup-buildx-action@v2
|
||||
-
|
||||
name: Login to registry
|
||||
uses: actions/docker-login-action@v2
|
||||
with:
|
||||
registry: git.amogus.cloud
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: actions/docker-build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ./api/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
Loading…
Reference in a new issue