PYRSS-Website/.gitea/workflows/docker-build.yaml
Corban-Lee Jones 9033e10852
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
testing docker workflow
2024-08-10 22:27:44 +01:00

76 lines
1.9 KiB
YAML

# name: Build and Push Docker Image
# run-name: ${{ gitea.actor }} is building and pushing a Docker Image
# on: [push]
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Build Docker image
# run: |
# docker build -t pyrss-website:latest .
# - name: Push Docker image
# run: |
# docker tag pyrss-website:latest xordk/pyrss-website:latest
# docker push xordk/pyrss-website:latest
# with:
# username: ${{ secrets.DOCKER_PASSWORD }}
# password: ${{ secrets.DOCKER_USERNAME }}
name: Docker Image
on:
push:
branches:
- "main"
tags:
- "v"
pull_request:
branches:
- "main"
jobs:
build-docker:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Meta
id: docker-meta
uses: docker/metadata-action@v5
with:
images: |
test
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
provenance: false
sbom: false