diff --git a/.github/workflows/Docker-alpine.yml b/.github/workflows/Docker-alpine.yml new file mode 100644 index 0000000..8a4201d --- /dev/null +++ b/.github/workflows/Docker-alpine.yml @@ -0,0 +1,78 @@ +name: Docker_alpine + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + push: + branches: [ development ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Pull Repo + run: | + git clone --branch $GITHUB_REF_NAME --depth 1 https://github.com/${GITHUB_REPOSITORY} repo + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: all + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false + tags: | + type=edge,suffix=-alpine,branch=development + type=sha,suffix=-alpine + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: ./repo + file: ./repo/Dockerfile.alpine + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile.alpine b/Dockerfile.alpine index ae92f92..ba4b990 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -12,6 +12,7 @@ RUN apk add --no-cache git bash imagemagick libmagic curl tzdata neofetch libzba && apk add --no-cache --update --virtual .build-deps gcc python3-dev musl-dev linux-headers \ && git config --global pull.ff only \ && pip install -r requirements.txt \ + && pip cache purge \ && apk del .build-deps ENTRYPOINT ["tini","--","bash","utils/docker-config.sh"] \ No newline at end of file