Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc7e573b49 | |||
| 151e66e0b3 | |||
| a05c7b2bbd |
54
.github/actions/common-docker-build/action.yml
vendored
Normal file
54
.github/actions/common-docker-build/action.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: 'Common Docker Build'
|
||||||
|
|
||||||
|
description: 'Reusable action for building and pushing Docker images'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
build_tags:
|
||||||
|
description: 'Tags for the Docker build'
|
||||||
|
required: true
|
||||||
|
manifest_tags:
|
||||||
|
description: 'Tags for the Docker manifest'
|
||||||
|
required: true
|
||||||
|
flavor:
|
||||||
|
description: 'Flavor for the Docker manifest'
|
||||||
|
required: true
|
||||||
|
docker_username:
|
||||||
|
description: 'DockerHub username'
|
||||||
|
required: true
|
||||||
|
docker_password:
|
||||||
|
description: 'DockerHub password'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ inputs.docker_username }}
|
||||||
|
password: ${{ inputs.docker_password }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ inputs.build_tags }}
|
||||||
|
platforms: linux/amd64, linux/arm64/v8, linux/arm/v7
|
||||||
|
|
||||||
|
- name: Create and push manifest
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: csmith1865/obscreen
|
||||||
|
tags: ${{ inputs.manifest_tags }}
|
||||||
|
flavor: ${{ inputs.flavor }}
|
||||||
56
.github/workflows/master.yml
vendored
56
.github/workflows/master.yml
vendored
@ -1,51 +1,31 @@
|
|||||||
name: Build and Push Docker images
|
name: Release build and push docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'version.txt'
|
- 'version.txt'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Read Version
|
- name: Read Version
|
||||||
id: version
|
id: version
|
||||||
run: echo "::set-output name=VERSION::$(cat version.txt)"
|
run: echo "::set-output name=VERSION::$(cat version.txt)"
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Call common build workflow
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: ./.github/actions/common-docker-build
|
||||||
|
with:
|
||||||
- name: Set up Docker Buildx
|
build_tags: |
|
||||||
uses: docker/setup-buildx-action@v1
|
csmith1865/obscreen:v${{ steps.version.outputs.VERSION }}
|
||||||
|
csmith1865/obscreen:latest
|
||||||
- name: Login to DockerHub
|
manifest_tags: type=semver,pattern=v${{ steps.version.outputs.VERSION }}
|
||||||
uses: docker/login-action@v1
|
flavor: latest=true
|
||||||
with:
|
docker_username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
docker_password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
jierka/obscreen:v${{ steps.version.outputs.VERSION }}
|
|
||||||
jierka/obscreen:latest
|
|
||||||
platforms: linux/amd64, linux/arm64/v8, linux/arm/v7
|
|
||||||
|
|
||||||
- name: Create and push manifest
|
|
||||||
uses: docker/metadata-action@v3
|
|
||||||
with:
|
|
||||||
images: jierka/obscreen
|
|
||||||
tags: type=semver,pattern=v{{version}}
|
|
||||||
flavor: |
|
|
||||||
latest=true
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
2.2.2
|
2.2.2
|
||||||
Loading…
Reference in New Issue
Block a user