mirror of
https://github.com/litruv/API-WebSocket-Bridge.git
synced 2026-07-24 02:36:03 +10:00
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
workflow_dispatch: # Add manual trigger
|
|
|
|
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: Set up environment variables
|
|
id: env
|
|
run: |
|
|
echo "IMAGE_TAG=api-websocket-bridge-${{ github.event.release.tag_name }}" >> $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: Log into GitHub Docker Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Transform tag to lowercase
|
|
id: lowercase
|
|
run: |
|
|
echo "::set-output name=TAG::$(echo ${{ env.IMAGE_TAG }} | tr '[:upper:]' '[:lower:]')"
|
|
|
|
- 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 }}/api-websocket-bridge:${{ steps.lowercase.outputs.TAG }}
|