Added workflow
All checks were successful
Build and push Docker image on push / docker (push) Successful in 58s
All checks were successful
Build and push Docker image on push / docker (push) Successful in 58s
This commit is contained in:
41
.gitea/workflows/docker-tag-build.yml
Normal file
41
.gitea/workflows/docker-tag-build.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Build and push Docker image on push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set variables
|
||||
shell: bash
|
||||
run: |
|
||||
echo "IMAGE_NAME=gitea.lostak.dev/lostakj/postfix" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Login to Gitea registry
|
||||
shell: bash
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.lostak.dev -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||
|
||||
- name: Create buildx builder
|
||||
shell: bash
|
||||
run: |
|
||||
docker buildx create --name ci-builder --use || docker buildx use ci-builder
|
||||
docker buildx inspect --bootstrap
|
||||
|
||||
- name: Build and push image
|
||||
shell: bash
|
||||
run: |
|
||||
docker buildx build \
|
||||
--platform linux/amd64 \
|
||||
-t "${IMAGE_NAME}:latest" \
|
||||
--push \
|
||||
.
|
||||
Reference in New Issue
Block a user