Update README.md #4
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: Docker Image CI | |
on: | |
pull_request: | |
branches: | |
- "main" | |
push: | |
branches: | |
- "main" | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
outputs: | |
image_date: ${{ steps.date.outputs.image_date }} | |
steps: | |
- name: Set build date for image tagging | |
id: date | |
run: echo "image_date=$(date +'%Y.%m.%d')" >> "$GITHUB_OUTPUT" | |
- name: Checkout repository | |
uses: actions/checkout@v4.0.0 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: image=moby/buildkit:latest | |
- name: Docker build | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: false | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ steps.date.outputs.image_date }} | |
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ github.sha }} | |
- name: Docker compose build | |
run: docker compose build | |
push: | |
needs: build | |
runs-on: ubuntu-24.04 | |
if: github.event_name == 'push' | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker push | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ needs.build.outputs.image_date }} | |
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ github.sha }} |