-
Notifications
You must be signed in to change notification settings - Fork 11k
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
1 parent
1eca1fb
commit d80cb71
Showing
1,084 changed files
with
10,601 additions
and
11,794 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,91 @@ | ||
name: 'Build Docker image' | ||
description: 'Build Rocket.Chat Docker image' | ||
|
||
inputs: | ||
root-dir: | ||
required: true | ||
docker-tag: | ||
required: true | ||
release: | ||
required: true | ||
username: | ||
required: false | ||
password: | ||
required: false | ||
deno-version: | ||
required: true | ||
type: string | ||
|
||
outputs: | ||
image-name: | ||
value: ${{ steps.build-image.outputs.image-name }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# - shell: bash | ||
# name: Free disk space | ||
# run: | | ||
# sudo swapoff -a | ||
# sudo rm -f /swapfile | ||
# sudo apt clean | ||
# docker rmi $(docker image ls -aq) | ||
# df -h | ||
|
||
- shell: bash | ||
id: build-image | ||
run: | | ||
cd ${{ inputs.root-dir }} | ||
LOWERCASE_REPOSITORY=$(echo "${{ github.repository_owner }}" | tr "[:upper:]" "[:lower:]") | ||
IMAGE_NAME_BASE="ghcr.io/${LOWERCASE_REPOSITORY}/rocket.chat:${{ inputs.docker-tag }}" | ||
IMAGE_NAME="${IMAGE_NAME_BASE}.${{ inputs.release }}" | ||
echo "Build Docker image ${IMAGE_NAME}" | ||
DOCKER_PATH="${GITHUB_WORKSPACE}/apps/meteor/.docker" | ||
if [[ '${{ inputs.release }}' = 'preview' ]]; then | ||
DOCKER_PATH="${DOCKER_PATH}-mongo" | ||
fi; | ||
DOCKERFILE_PATH="${DOCKER_PATH}/Dockerfile" | ||
if [[ '${{ inputs.release }}' = 'debian' ]]; then | ||
DOCKERFILE_PATH="${DOCKERFILE_PATH}.${{ inputs.release }}" | ||
fi; | ||
echo "Copy Dockerfile for release: ${{ inputs.release }}" | ||
cp $DOCKERFILE_PATH ./Dockerfile | ||
if [ -e ${DOCKER_PATH}/entrypoint.sh ]; then | ||
cp ${DOCKER_PATH}/entrypoint.sh . | ||
fi; | ||
echo "Build ${{ inputs.release }} Docker image" | ||
docker build --build-arg DENO_VERSION=${{ inputs.deno-version }} -t $IMAGE_NAME . | ||
echo "image-name-base=${IMAGE_NAME_BASE}" >> $GITHUB_OUTPUT | ||
echo "image-name=${IMAGE_NAME}" >> $GITHUB_OUTPUT | ||
- name: Login to GitHub Container Registry | ||
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} | ||
|
||
- name: Publish image | ||
shell: bash | ||
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop' | ||
run: | | ||
echo "Push Docker image: ${{ steps.build-image.outputs.image-name }}" | ||
docker push ${{ steps.build-image.outputs.image-name }} | ||
if [[ '${{ inputs.release }}' = 'official' ]]; then | ||
echo "Push release official without variant" | ||
docker tag ${{ steps.build-image.outputs.image-name }} ${{ steps.build-image.outputs.image-name-base }} | ||
docker push ${{ steps.build-image.outputs.image-name-base }} | ||
fi; |
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
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
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
Oops, something went wrong.