fix: update Dockerfile to fix platform name #11
Workflow file for this run
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: Publish Docker image | |
on: | |
workflow_dispatch: | |
inputs: | |
snell_server_version: | |
description: 'snell server version, eg: 4.0.1' | |
required: true | |
push: | |
tags: | |
- "*" | |
env: | |
IMAGE_REPOSITORY: funnyzak/snell-server | |
jobs: | |
docker-release: | |
name: Publish Docker images | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get version from push tag | |
if: github.event_name == 'push' | |
run: | | |
echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | |
- name: Get version from workflow_dispatch | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
echo "VERSION=${{ github.event.inputs.snell_server_version}}" >> $GITHUB_ENV | |
- name: Set build date | |
run: | | |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV | |
- name: Echo env | |
run: | | |
echo "VERSION=${{ env.VERSION }}" | |
echo "BUILD_DATE=${{ env.BUILD_DATE }}" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
build-args: | | |
BUILD_DATE=${{ env.BUILD_DATE }} | |
SNELL_SERVER_VERSION=${{ env.VERSION }} | |
push: true | |
tags: | | |
${{ env.IMAGE_REPOSITORY }}:${{ env.VERSION }} | |
${{ env.IMAGE_REPOSITORY }}:latest | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
linux/arm/v7 | |
linux/i386 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push-message: | |
name: Push message | |
runs-on: ubuntu-latest | |
needs: [docker-release] | |
steps: | |
- name: Push message | |
uses: funnyzak/pushoo-action@main | |
with: | |
platforms: ifttt | |
tokens: ${{ secrets.PUSH_TOKEN }} | |
content: | | |
# ${{ github.event.repository.name }} Docker Build Success | |
## trigger: ${{ github.event_name }} at ${{ github.event.head_commit.timestamp }} | |
## commit message: ${{ github.event.head_commit.message }} | |
## commit url: ${{ github.event.head_commit.url }} | |
## commit author: ${{ github.event.head_commit.author.name }} | |
## commit email: ${{ github.event.head_commit.author.email }} | |
## commit id: ${{ github.event.head_commit.id }} | |
title: | | |
${{ github.repository }} ${{ github.event_name }} Message | |
options: '{"bark": { "url": "https://github.com/${{github.repository}}" }}' | |
debug: false |