Skip to content

ci build: add

ci build: add #1

Workflow file for this run

# Copyright (C) 2025 Sutou Kouhei <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
name: Build
on:
- push
- pull_request
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.id }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
id:
- "proxy"
- "debian"
- "ubuntu"
steps:
- name: Parse ID
run: |
set -x
if [ ${{ matrix.id }} == "proxy" ]; then
context=${{ matrix.id }}
tag=${{ matrix.id }}
else
context=chupa-text/${{ matrix.id }}
tag=${{ matrix.id }}-latest
fi
tags="ghcr.io/${GITHUB_REPOSITORY}:${tag}"
need_push="no"
if [ "${GITHUB_EVENT_NAME}" = "push" ]; then
need_push="yes"
fi
echo "CONTEXT=${context}" >> ${GITHUB_ENV}
echo "TAGS=${tags}" >> ${GITHUB_ENV}
echo "NEED_PUSH=${need_push}" >> ${GITHUB_ENV}
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/setup-buildx-action@v3
id: buildx
- uses: docker/build-push-action@v6
id: docker_build
with:
context: ${{ env.CONTEXT }}
push: ${{ env.NEED_PUSH == 'yes' }}
tags: ${{ env.TAGS }}
- name: Image info
run: |
echo "ref: ${{ github.ref }}"
echo "tags: ${{ env.TAGS }}"
echo "digest: ${{ steps.docker_build.outputs.digest }}"