github actions rewrite

This commit is contained in:
2023-08-02 14:47:38 +02:00
parent e2dd54add2
commit 8c57a7bb28
4 changed files with 68 additions and 36 deletions

View File

@@ -7,12 +7,9 @@ name: Docker (ghcr.io)
on:
release:
branches: [ master ]
tags: [ 'v*.*.*' ]
types: [published]
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron : '0 1 * * 0'
@@ -24,8 +21,7 @@ env:
jobs:
build:
build-ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
@@ -33,7 +29,6 @@ jobs:
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
@@ -46,7 +41,6 @@ jobs:
with:
cosign-release: 'v1.13.1'
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
@@ -95,3 +89,22 @@ jobs:
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}
build-dockerhub:
runs-on: ubuntu-latest
env:
REGISTRY: 'docker.io'
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
env:
DOCKER_USER: ${{secrets.DOCKER_HUB_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Install buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Build the Docker image
run: docker buildx build . --file Dockerfile --tag ${{secrets.DOCKER_HUB_USERNAME}}/yt-dlp-webui:latest --push --platform linux/amd64,linux/arm/v7,linux/arm64