etherpad-lite/.github/workflows/docker.yml
SamTV12345 77792a5f7f
Some checks are pending
Backend tests / Linux without plugins (push) Waiting to run
Backend tests / Linux with Plugins (push) Waiting to run
Backend tests / Windows without plugins (push) Waiting to run
Backend tests / Windows with Plugins (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Docker / docker (push) Waiting to run
Frontend admin tests powered by Sauce Labs / with plugins (push) Waiting to run
Frontend tests powered by Sauce Labs / Playwright Chrome (push) Waiting to run
Frontend tests powered by Sauce Labs / Playwright Firefox (push) Waiting to run
Frontend tests powered by Sauce Labs / Playwright Webkit (push) Waiting to run
Loadtest / without plugins (push) Waiting to run
Loadtest / with Plugins (push) Waiting to run
Loadtest / long running (push) Waiting to run
Perform type checks / perform type check (push) Waiting to run
rate limit / test (push) Waiting to run
Upgrade from latest release / Linux with Plugins (push) Waiting to run
Windows Build / Build .zip (push) Waiting to run
Change if condition
2025-04-07 21:47:45 +02:00

143 lines
4.4 KiB
YAML

name: Docker
on:
pull_request:
paths-ignore:
- 'doc/**'
push:
branches:
- 'develop'
paths-ignore:
- 'doc/**'
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
env:
TEST_TAG: etherpad/etherpad:test
permissions:
contents: read
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Check out
uses: actions/checkout@v4
with:
path: etherpad
-
name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and export to Docker
uses: docker/build-push-action@v6
with:
context: ./etherpad
target: production
load: true
tags: ${{ env.TEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
-
name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.0.4
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
-
name: Test
working-directory: etherpad
run: |
docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }}
./bin/installDeps.sh
docker logs -f test &
while true; do
echo "Waiting for Docker container to start..."
status=$(docker container inspect -f '{{.State.Health.Status}}' test) || exit 1
case ${status} in
healthy) break;;
starting) sleep 2;;
*) printf %s\\n "unexpected status: ${status}" >&2; exit 1;;
esac
done
(cd src && pnpm run test-container)
git clean -dxf .
-
name: Docker meta
if: github.event_name == 'push'
id: meta
uses: docker/metadata-action@v5
with:
images: etherpad/etherpad
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
-
name: Log in to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: build-docker
if: github.event_name == 'push'
uses: docker/build-push-action@v6
with:
context: ./etherpad
target: production
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Update repo description
uses: peter-evans/dockerhub-description@v4
if: github.ref == 'refs/heads/master'
with:
readme-filepath: ./etherpad/README.md
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: etherpad/etherpad
enable-url-completion: true
- name: Check out
uses: actions/checkout@v4
with:
path: ether-charts
repository: ether/ether-charts
token: ${{ secrets.ETHER_CHART_TOKEN }}
- name: Update tag in values-dev.yaml
if: success() && github.ref == 'refs/heads/develop'
working-directory: ether-charts
run: |
sed -i 's/tag: ".*"/tag: "${{ steps.build-docker.outputs.digest }}"/' values-dev.yaml
- name: Commit and push changes
working-directory: ether-charts
if: success() && github.ref == 'refs/heads/develop'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add values-dev.yaml
git commit -m 'Update develop image tag'
git push