Skip to content

Commit a70487a

Browse files
committed
rewrite yaml file as well
1 parent 0f5c3cc commit a70487a

File tree

1 file changed

+18
-41
lines changed

1 file changed

+18
-41
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,56 +34,33 @@ jobs:
3434
musl-target: aarch64-linux-musl
3535

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

5938
- name: Checkout sources
6039
uses: actions/checkout@v3
6140

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

44+
- name: Login to GHCR
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.repository_owner }}
49+
password: ${{ secrets.GHCR_TOKEN }}
50+
6751
- name: Convert GITHUB_REPOSITORY into lowercase
6852
run: |
6953
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
7054
71-
- name: Build ${{ matrix.tag }}
72-
run: |
73-
podman build \
74-
--format docker \
75-
--arch ${{ matrix.arch }} \
76-
--build-arg FEATURES=${{ matrix.features }} \
77-
--build-arg RUST_TARGET=${{ matrix.rust-target }} \
78-
--build-arg MUSL_TARGET=${{ matrix.musl-target }} \
79-
-t http-proxy:${{ matrix.tag }} \
80-
.
81-
82-
- name: Push image
83-
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
84-
run: |
85-
podman tag http-proxy:${{ matrix.tag }} ghcr.io/${REPO}:${{ matrix.tag }}
86-
podman push ghcr.io/${REPO}:${{ matrix.tag }}
55+
- name: Build and push ${{ matrix.tag }}
56+
uses: docker/build-push-action@v5
57+
with:
58+
push: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
59+
tags: http-proxy:${{ matrix.tag }}
60+
build-args: |
61+
FEATURES=${{ matrix.features }}
62+
RUST_TARGET=${{ matrix.rust-target }}
63+
MUSL_TARGET=${{ matrix.musl-target }}
8764
8865
create-manifest:
8966
name: Create Docker manifests

0 commit comments

Comments
 (0)