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: on:
release: release:
types: [created] types: [created]
workflow_dispatch: # Add manual trigger
jobs: jobs:
build: build:
@@ -11,7 +12,7 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Log into Docker registry - name: Log into Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: docker.io registry: docker.io
@@ -23,9 +24,23 @@ jobs:
run: | run: |
echo "IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV 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 uses: docker/build-push-action@v2
with: with:
context: . context: .
push: true push: true
tags: docker.io/litruv/api-websocket-bridge:${{ env.IMAGE_TAG }} 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 }}