Skip to content

Build Docker image latest version #40

Build Docker image latest version

Build Docker image latest version #40

name: Build Docker image latest version
on:
workflow_dispatch:
# schedule:
# - cron: '0 12 * * 1'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- id: keydb
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: jagrosh
repo: MusicBot
excludes: prerelease, draft
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S%:z')"
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7
push: true
tags: |
bas0korver/jmusicbot:latest
bas0korver/jmusicbot:${{ steps.keydb.outputs.release }}
ghcr.io/bas-korver/jmusicbot:latest
ghcr.io/bas-korver/jmusicbot:${{ steps.keydb.outputs.release }}
build-args: |
JMUSICBOT_VERSION=${{ steps.keydb.outputs.release }}
BUILDDATE=${{ steps.date.outputs.date }}