Skip to content

Commit

Permalink
rewrite yaml file as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Erk- committed Mar 12, 2024
1 parent 0f5c3cc commit a70487a
Showing 1 changed file with 18 additions and 41 deletions.
59 changes: 18 additions & 41 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,56 +34,33 @@ jobs:
musl-target: aarch64-linux-musl

steps:
# Podman 4.x is necessary here because it supports --platform=$BUILDPLATFORM. Otherwise, podman
# would pull the base image for aarch64 when building for aarch64. See https://github.com/containers/buildah/pull/3757
# for the implementation. GitHub actions currently still ship Podman 3.x, even though 4.x has been
# out for over a year.
# The repository used is the same as GitHub actions uses for their source - just that it's the unstable version
# rather than the stable one.
# TODO: Once podman 4.x is available in actions by default (or in the Ubuntu repositories), remove this.
- name: Install podman 4.x
run: |
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt -qq -y purge buildah podman
sudo apt -qq -y autoremove --purge
sudo apt update -qq
sudo apt -qq -y install podman

- name: Checkout sources
uses: actions/checkout@v3

- name: Login to ghcr
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Convert GITHUB_REPOSITORY into lowercase
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build ${{ matrix.tag }}
run: |
podman build \
--format docker \
--arch ${{ matrix.arch }} \
--build-arg FEATURES=${{ matrix.features }} \
--build-arg RUST_TARGET=${{ matrix.rust-target }} \
--build-arg MUSL_TARGET=${{ matrix.musl-target }} \
-t http-proxy:${{ matrix.tag }} \
.
- name: Push image
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
run: |
podman tag http-proxy:${{ matrix.tag }} ghcr.io/${REPO}:${{ matrix.tag }}
podman push ghcr.io/${REPO}:${{ matrix.tag }}
- name: Build and push ${{ matrix.tag }}
uses: docker/build-push-action@v5
with:
push: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
tags: http-proxy:${{ matrix.tag }}
build-args: |
FEATURES=${{ matrix.features }}
RUST_TARGET=${{ matrix.rust-target }}
MUSL_TARGET=${{ matrix.musl-target }}
create-manifest:
name: Create Docker manifests
Expand Down

0 comments on commit a70487a

Please sign in to comment.