Skip to content

Commit

Permalink
Create publish-release.yml (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
snixtho authored Jul 26, 2024
1 parent 663d43d commit a179d1b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Release to Docker Hub
on:
push:
tags:
- '*.*.*'

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Prepare Environment
id: env
run: |
DOCKER_IMAGE=evoesports/evosc-sharp
VERSION=${{github.ref_name}}
echo "tags=${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest" >> $GITHUB_OUTPUT
echo "builddate=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.env.outputs.tags }}
build-args: |
BUILD_DATE=${{ steps.env.outputs.builddate }}
REVISION=${{ steps.env.outputs.revision }}
EVOSC_VERSION=${{ steps.env.outputs.version }}

0 comments on commit a179d1b

Please sign in to comment.