Workflow file for this run
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
name: apt-cacher-ng Docker Image Publishing | |
on: | |
release: | |
types: [published] | |
env: | |
LATEST_TAG: jammy | |
jobs: | |
publish: | |
name: Build and test apt-cacher-ng | |
strategy: | |
matrix: | |
image_os: [focal, jammy] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get enviroment variables | |
run: | | |
grep -v '#' .env-dist | grep '=' > .env | |
while IFS= read -r line; do | |
echo $line >> $GITHUB_ENV ; | |
done < .env | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.IMAGE_NAME }} | |
ghcr.io/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=${{ matrix.image_os == env.LATEST_TAG }} | |
suffix=-${{ matrix.image_os }},onlatest=false | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push apt-cacher | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
build-args: | | |
BASE_VERSION=${{ env.BASE_VERSION }} | |
IMAGE_VERSION=${{ env.IMAGE_VERSION }} | |
UID=${{ env.UID }} | |
GID=${{ env.GID }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |