-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Docker Build and Push | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract version from release | ||
id: version_tag | ||
run: | | ||
# Extract the version from the release tag, removing any 'v' prefix | ||
VERSION_TAG="${GITHUB_REF#refs/tags/}" | ||
CLEAN_VERSION=$(echo "$VERSION_TAG" | sed 's/^v//') | ||
echo "##[set-output name=version;]${CLEAN_VERSION}" | ||
# Publish WinArena Base image | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./src/win-arena-container/Dockerfile-WinArena-Base | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/winarena-base:${{ steps.version_tag.outputs.version }} | ||
|
||
- name: Build and push latest | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./src/win-arena-container/Dockerfile-WinArena-Base | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/winarena-base:latest | ||
|
||
# Publish WinArena image | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./src/win-arena-container/Dockerfile-WinArena | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/winarena:${{ steps.version_tag.outputs.version }} | ||
|
||
- name: Build and push latest | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./src/win-arena-container/Dockerfile-WinArena | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/winarena:latest |