mirror of
https://github.com/litruv/API-WebSocket-Bridge.git
synced 2026-07-24 02:36:03 +10:00
51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
workflow_dispatch:
|
|
inputs:
|
|
image_tag:
|
|
description: 'Enter the image tag'
|
|
required: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Log into Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: docker.io
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Log into GitHub Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up environment variables
|
|
id: env
|
|
run: |
|
|
echo "IMAGE_TAG=${{ github.event.release.tag_name || inputs.image_tag }}" >> $GITHUB_ENV
|
|
|
|
- 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: Build and push Docker image to GitHub Container Registry
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ghcr.io/${{ github.repository_owner }}/api-websocket-bridge:${{ env.IMAGE_TAG }}
|