mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-05-16 08:51:44 +00:00
Create deploy_docker_ghcr.yml
This commit is contained in:
parent
9fc2796dbf
commit
5a8466bfa1
1 changed files with 59 additions and 0 deletions
59
.github/workflows/deploy_docker_ghcr.yml
vendored
Normal file
59
.github/workflows/deploy_docker_ghcr.yml
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
paths:
|
||||
- 'addon/**'
|
||||
- '.github/**'
|
||||
|
||||
env:
|
||||
IMAGE_NAME: torrentio-addon
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
${{ secrets.DOCKER_USERNAME || env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
|
||||
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=sha,format=short
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: ${{ secrets.DOCKER_USERNAME || env.DOCKER_USERNAME }}
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME || env.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD || env.DOCKER_PASSWORD || secrets.DOCKER_TOKEN || env.DOCKER_TOKEN }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN || github.token }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./addon/
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
Loading…
Reference in a new issue