Initial commit
This commit is contained in:
127
.github/workflows/docker_build.yml
vendored
Normal file
127
.github/workflows/docker_build.yml
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
name: docker-build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
- synchronize
|
||||
|
||||
concurrency:
|
||||
# One concurrency group per workflow + ref.
|
||||
#
|
||||
# - PRs use `refs/pull/<PR_NUMBER>/merge`, so new commits cancel older
|
||||
# in-progress runs for the same PR.
|
||||
# - When a PR is merged, a push to the target branch starts a new group,
|
||||
# canceling any still-running PR CI.
|
||||
# - Branch pushes are isolated by ref.
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
COMPOSE_DOCKER_CLI_BUILD: 1
|
||||
DOCKER_BUILDKIT: 1
|
||||
RUNNING_ON_PRIMARY_BRANCH: |
|
||||
${{ (github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master') && 'true' || 'false' }}
|
||||
|
||||
jobs:
|
||||
build-containers:
|
||||
runs-on: "ubuntu-latest"
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
steps:
|
||||
- name: Free up disk space
|
||||
run: |
|
||||
sudo rm -rf /usr/local/lib/android
|
||||
sudo rm -rf /usr/share/dotnet
|
||||
sudo rm -rf /opt/ghc
|
||||
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# The containers created in this workflow are used by
|
||||
# acore-docker, which has a dependency on mod-ale.
|
||||
#
|
||||
# If you're wanting containers without mod-ale, the best solution is to
|
||||
# build them locally (such as with `docker compose build`)
|
||||
- name: Download Eluna
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: azerothcore/mod-ale
|
||||
path: modules/mod-ale
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
version="$(jq -r '.version' acore.json)"
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: build worldserver
|
||||
uses: ./.github/actions/docker-tag-and-build
|
||||
with:
|
||||
component-name: worldserver
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }}
|
||||
|
||||
- name: build authserver
|
||||
uses: ./.github/actions/docker-tag-and-build
|
||||
with:
|
||||
component-name: authserver
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }}
|
||||
|
||||
- name: build db-import
|
||||
uses: ./.github/actions/docker-tag-and-build
|
||||
with:
|
||||
component-name: db-import
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }}
|
||||
|
||||
- name: build client-data
|
||||
uses: ./.github/actions/docker-tag-and-build
|
||||
with:
|
||||
component-name: client-data
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }}
|
||||
|
||||
- name: build tools
|
||||
uses: ./.github/actions/docker-tag-and-build
|
||||
with:
|
||||
component-name: tools
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }}
|
||||
|
||||
- name: build dev-server
|
||||
uses: ./.github/actions/docker-tag-and-build
|
||||
with:
|
||||
component-name: dev
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }}
|
||||
dockerfile: apps/docker/Dockerfile.dev-server
|
||||
|
||||
- name: Trigger acore-docker CI
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.ACORE_DOCKER_REPO_ACCESS_TOKEN }}
|
||||
repository: azerothcore/acore-docker
|
||||
event-type: azerothcore-new-images
|
||||
client-payload: >
|
||||
{
|
||||
"ref": "${{ github.ref_name }}",
|
||||
"sha": "${{ github.sha }}"
|
||||
}
|
||||
Reference in New Issue
Block a user