π· build(devcontainer): Fix issue with multi-architecture #20
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: Dev Container Build and Push Image | |
on: | |
push: | |
branches: [main] | |
paths: | |
- .github/workflows/devcontainer-build-and-push.yaml | |
- '.github/.devcontainer/**' | |
pull_request: | |
paths: | |
- .github/workflows/devcontainer-build-and-push.yaml | |
- '.github/.devcontainer/**' | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the GitHub Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install updated skopeo | |
# https://github.com/devcontainers/ci/issues/191#issuecomment-1416384710 | |
run: | | |
sudo apt purge buildah golang-github-containers-common podman skopeo | |
sudo apt autoremove --purge | |
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable" | |
source /etc/os-release | |
sudo sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" | |
sudo wget -qnv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key | |
sudo apt-key add Release.key | |
sudo apt-get update | |
sudo apt-get install skopeo -y | |
- name: Pre-build dev container image | |
uses: devcontainers/[email protected] | |
with: | |
subFolder: .github | |
imageName: ghcr.io/${{ github.repository }}/devcontainer | |
cacheFrom: ghcr.io/${{ github.repository }}/devcontainer | |
platform: linux/amd64,linux/arm64 | |
push: always |