Skip to content

Commit

Permalink
Merge pull request #26 from umarcor/ci/docker-cleanup
Browse files Browse the repository at this point in the history
ci: cleanup container sources
  • Loading branch information
mithro authored Apr 27, 2021
2 parents 5202404 + bfd526b commit 0beffe7
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 127 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/docker-publish.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:


run:
strategy:
fail-fast: false
Expand Down Expand Up @@ -121,3 +122,50 @@ jobs:
token: ${{ github.token }}
tag: nightly
files: ./**


container:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
needs: [ test ]
runs-on: ubuntu-latest
env:
IMAGE_NAME: fomu-toolchain

steps:

- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/download-artifact@v2
with:
name: fomu-toolchain-Linux

- name: Build image
run: docker build -t $IMAGE_NAME -f Dockerfile .

- name: Login to docker.io
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: "${{ github.actor }}"
password: "${{ github.token }}"

- name: Push image
run: |
IMAGE_ID=$(echo "docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME" | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
File renamed without changes.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3-slim-buster

RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
ca-certificates \
libusb-1.0-0 \
make \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists

ADD fomu-toolchain-Linux.tar.gz /opt

ENV PATH=/opt/fomu-toolchain-Linux/bin:$PATH

ENV USER=fomu
RUN adduser --disabled-password ${USER}

RUN usermod -a -G plugdev ${USER}

COPY 99-fomu.rules /etc/udev/rules.d/

USER ${USER}
WORKDIR /home/${USER}
76 changes: 0 additions & 76 deletions dockerfiles/Dockerfile.use-installer

This file was deleted.

0 comments on commit 0beffe7

Please sign in to comment.