Update registry.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Images to GHCR | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
push-to-ghcr: | |
name: Push Docker image to GHCR | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@main | |
- name: 'Login to GHCR' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: 'Build Image' | |
run: docker build . --tag ghcr.io/hemantapkh/torrenthunt:latest | |
- name: 'Push to GHCR' | |
run: docker push ghcr.io/hemantapkh/torrenthunt:latest | |
push-to-docker-hub: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: hemantapkh/torrenthunt | |
- name: Build and push Docker image | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
hemantapkh/torrenthunt:latest | |
labels: ${{ steps.meta.outputs.labels }} |