Updated docker-compose #13
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 Buildx master | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
docker: | |
name: Build and push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Short the sha to 7 characters only | |
id: vars | |
run: | | |
echo ::set-output name=tag::$(echo ${GITHUB_SHA::10}) | |
echo "outputs tags: ${{ steps.vars.outputs.tag }}" | |
- | |
name: Set build environment github.ref | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
id: tag | |
run: | | |
echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} | |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} | |
- | |
name: Inspect builder | |
run: | | |
echo "Name: ${{ steps.buildx.outputs.name }}" | |
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" | |
echo "Status: ${{ steps.buildx.outputs.status }}" | |
echo "Flags: ${{ steps.buildx.outputs.flags }}" | |
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | |
echo "outputs tags: ${{ steps.vars.outputs.tag }}" | |
echo "github.sha : ${{ github.sha }}" | |
echo "github.ref : ${{ github.ref }}" | |
echo "date : $(date +%s)" | |
echo "outputs version : ${{ steps.tag.outputs.version }}" | |
echo "outputs SOURCE_TAG : ${{ steps.tag.outputs.SOURCE_TAG }}" | |
echo "outputs RELEASE_VERSION : $RELEASE_VERSION" | |
- | |
name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: j0n4n/deezspot_bot_docker:latest | |
- | |
name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |