Update docker-push.yml, support gh

This commit is contained in:
2023-06-12 15:00:27 +10:00
committed by GitHub
parent ece2679625
commit 88bcefdc5a

View File

@@ -3,6 +3,7 @@ name: Docker
on:
release:
types: [created]
workflow_dispatch: # Add manual trigger
jobs:
build:
@@ -11,7 +12,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log into Docker registry
- name: Log into Docker Hub
uses: docker/login-action@v1
with:
registry: docker.io
@@ -23,9 +24,23 @@ jobs:
run: |
echo "IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Build and push Docker image
- name: Build and push Docker image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: docker.io/litruv/api-websocket-bridge:${{ env.IMAGE_TAG }}
- name: Log into GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image to GitHub Docker Registry
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}