Skip to content

Commit

Permalink
Publish container to ghcr.io
Browse files Browse the repository at this point in the history
Remove arch linux armv7/v8 docker containers.
  • Loading branch information
dbast committed Dec 26, 2023
1 parent f7181a0 commit 084e6c9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 325 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/archlinuxarm-armv7-docker.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/archlinuxarm-armv8-docker.yml

This file was deleted.

101 changes: 46 additions & 55 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
tags:
- 'v*'
branches: [ master ]
branches:
- master
- development
pull_request:
schedule:
# once a week
Expand All @@ -15,6 +17,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
Expand All @@ -34,71 +40,56 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

#- name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: |
# mkaczanowski/packer-builder-arm
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=match,pattern=v(.*),group=1
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=match,pattern=v(.*),group=1
#### build+export, test only on PRs
#- name: Build and export to Docker
# if: github.event_name == 'pull_request'
# uses: docker/build-push-action@v5
# with:
# context: .
# file: docker/Dockerfile
# load: true
# tags: packer-plugin-cross:test
# labels: ${{ steps.meta.outputs.labels }}
### build+export, test only on PRs
- name: Build and export to Docker
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
load: true
tags: packer-plugin-cross:test
labels: ${{ steps.meta.outputs.labels }}

- name: Install packer plugins
if: github.event_name == 'pull_request'
run: |
docker run --rm --privileged -v /dev:/dev -v ${PWD}:/build packer-builder-arm:test init boards/raspberry-pi-4/archlinuxarm.pkr.hcl
docker run --rm --privileged -v /dev:/dev -v ${PWD}:/build packer-plugin-cross:test init boards/raspberry-pi-4/archlinuxarm.pkr.hcl
- name: Test build board
if: github.event_name == 'pull_request'
run: |
docker run --rm --privileged -v /dev:/dev -v ${PWD}:/build packer-builder-arm:test build boards/raspberry-pi-4/archlinuxarm.pkr.hcl -extra-system-packages=bmap-tools,zstd
docker run --rm --privileged -v /dev:/dev -v ${PWD}:/build packer-plugin-cross:test build boards/raspberry-pi-4/archlinuxarm.pkr.hcl -extra-system-packages=bmap-tools,zstd
du -h raspberry-pi-4.img
du -h --apparent-size raspberry-pi-4.img
####

# - name: Login to DockerHub
# uses: docker/login-action@v3
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
# with:
# username: ${{ secrets.DOCKER_USER }}
# password: ${{ secrets.DOCKER_PASSWORD }}

# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GHCR_IO_REGISTRY_TOKEN }}

#- name: Build and push
# uses: docker/build-push-action@v5
# if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') }}
# with:
# context: .
# file: docker/Dockerfile
# platforms: linux/amd64,linux/arm64
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags') }}
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

#- name: Update description
# uses: peter-evans/dockerhub-description@v3
# if: github.ref == 'refs/heads/master'
# with:
# username: ${{ secrets.DOCKER_USER }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# short-description: Packer plugin to build ARM images
# readme-filepath: ./README.md
- name: Build and push
uses: docker/build-push-action@v5
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags') }}
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
76 changes: 0 additions & 76 deletions boards/armv7/archlinuxarm-docker.pkr.hcl

This file was deleted.

Loading

0 comments on commit 084e6c9

Please sign in to comment.