Skip to content

Commit

Permalink
Add github actions.
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Graf <[email protected]>
  • Loading branch information
ItsPhenom committed May 22, 2023
1 parent 8dad469 commit e18b053
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker Publish
on:
release:
types: [published]

jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Prepare
id: prep
run: |
DOCKER_IMAGE=evoesports/armagetronad
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION}
echo ::set-output name=builddate::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=revision::$(git rev-parse --short HEAD)
-
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: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ steps.prep.outputs.tags }}
build-args: |
VERSION=${{ steps.prep.outputs.version }}
BUILD_DATE=${{ steps.prep.outputs.builddate }}
REVISION=${{ steps.prep.outputs.revision }}
-
name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: evoesports/armagetronad

0 comments on commit e18b053

Please sign in to comment.