Update docker-build.yaml
This commit is contained in:
parent
1a695be1d1
commit
3d22f64c2b
@ -1,53 +1,22 @@
|
|||||||
name: Docker Image
|
name: Build and Push Docker Image
|
||||||
run-name: Build and push Docker Image
|
run-name: ${{ gitea.actor }} is building and pushing a Docker Image
|
||||||
|
on: [push]
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
tags:
|
|
||||||
- "v"
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-20.04
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Build Docker image
|
||||||
uses: docker/login-action@v2
|
run: |
|
||||||
with:
|
docker build -t pyrss-website:latest .
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Docker Meta
|
- name: Push Docker image
|
||||||
id: docker-meta
|
run: |
|
||||||
uses: docker/metadata-action@v5
|
docker tag pyrss-website:latest xordk/pyrss-website:latest
|
||||||
|
docker push xordk/pyrss-website:latest
|
||||||
with:
|
with:
|
||||||
images: |
|
username: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
test
|
password: ${{ secrets.DOCKER_USERNAME }}
|
||||||
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user