0.5.13 #7
Workflow file for this run
This file contains hidden or 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: "Build and Publish Docker" | |
| permissions: | |
| contents: read | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag for Docker image' | |
| required: false | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Determine Docker tag | |
| id: docker_tag | |
| run: | | |
| if [ "${{ github.event_name }}" == "release" ]; then | |
| echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
| elif [ -n "${{ github.event.inputs.version }}" ]; then | |
| echo "TAG=${{ github.event.inputs.version }}" >> $GITHUB_ENV | |
| else | |
| echo "TAG=latest" >> $GITHUB_ENV | |
| fi | |
| echo "Docker tag set to $TAG" | |
| - name: Update config.json host before build | |
| run: | | |
| jq '.server.host = "0.0.0.0"' config.json > config.tmp.json | |
| mv config.tmp.json config.json | |
| - name: Build and push Docker image | |
| env: | |
| IMAGE_NAME: dorowolf/akari-bot-webrender | |
| run: | | |
| docker buildx create --use | |
| docker buildx build \ | |
| --platform linux/amd64,linux/arm64 \ | |
| -t $IMAGE_NAME:$TAG \ | |
| -t $IMAGE_NAME:latest \ | |
| --push . |