testing docker workflow
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
parent
7a29e8413d
commit
9033e10852
@ -1,22 +1,75 @@
|
||||
name: Build and Push Docker Image
|
||||
run-name: ${{ gitea.actor }} is building and pushing a Docker Image
|
||||
on: [push]
|
||||
# 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:
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-20.04
|
||||
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
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_PASSWORD }}
|
||||
password: ${{ secrets.DOCKER_USERNAME }}
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user