Combined old and new GH actions for docker
This commit is contained in:
parent
0722f43727
commit
54ea8a373a
2 changed files with 4 additions and 64 deletions
54
.github/workflows/build_and_push_docker.yml
vendored
54
.github/workflows/build_and_push_docker.yml
vendored
|
|
@ -1,54 +0,0 @@
|
||||||
name: Build and Push Docker Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
image_tag:
|
|
||||||
type: choice
|
|
||||||
description: 'Docker Image Tag'
|
|
||||||
required: true
|
|
||||||
default: 'dev'
|
|
||||||
options:
|
|
||||||
- 'dev'
|
|
||||||
- 'latest'
|
|
||||||
platforms:
|
|
||||||
type: choice
|
|
||||||
description: 'Build Platforms'
|
|
||||||
required: true
|
|
||||||
default: 'linux/amd64,linux/arm64'
|
|
||||||
options:
|
|
||||||
- 'linux/amd64,linux/arm64'
|
|
||||||
- 'linux/amd64'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to GHCR
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
platforms: ${{ github.event.inputs.platforms }}
|
|
||||||
push: true
|
|
||||||
file: ./selfhosted.Dockerfile
|
|
||||||
tags: |
|
|
||||||
keglin/pinchflat:${{ github.event.inputs.image_tag }}
|
|
||||||
ghcr.io/${{ github.repository_owner }}/pinchflat:${{ github.event.inputs.image_tag }}
|
|
||||||
14
.github/workflows/docker_release.yml
vendored
14
.github/workflows/docker_release.yml
vendored
|
|
@ -38,6 +38,7 @@ jobs:
|
||||||
images: |
|
images: |
|
||||||
docker.io/keglin/pinchflat
|
docker.io/keglin/pinchflat
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}
|
||||||
|
# All non-release actions will be tagged as `dev` (ie: push, workflow_dispatch)
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}},prefix=v
|
type=semver,pattern={{version}},prefix=v
|
||||||
type=semver,pattern={{major}}.{{minor}},prefix=v
|
type=semver,pattern={{major}}.{{minor}},prefix=v
|
||||||
|
|
@ -65,21 +66,14 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Echo outputs
|
|
||||||
run: |
|
|
||||||
echo "${{ github.event_name }}"
|
|
||||||
echo "${{ steps.meta.outputs.tags }}"
|
|
||||||
echo "${{ steps.meta.outputs.labels }}"
|
|
||||||
echo "${{ github.event.inputs.platforms }}"
|
|
||||||
echo "${{ github.event.inputs.platforms || env.release_arch }}"
|
|
||||||
echo "${{ github.event_name == 'release' && env.release_arch || (github.event.inputs.platforms || env.dev_arch) }}"
|
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./selfhosted.Dockerfile
|
file: ./selfhosted.Dockerfile
|
||||||
|
# If the event is a release, use the release_arch, otherwise use the
|
||||||
|
# platforms input if present, falling back to dev_arch
|
||||||
platforms: ${{ github.event_name == 'release' && env.release_arch || (github.event.inputs.platforms || env.dev_arch) }}
|
platforms: ${{ github.event_name == 'release' && env.release_arch || (github.event.inputs.platforms || env.dev_arch) }}
|
||||||
push: false # TODO: Set to true once everything is proven to work
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue