Skip to content

Commit

Permalink
updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shitwolfymakes committed Mar 22, 2022
1 parent 8d619fb commit e2b12e3
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 1 deletion.
83 changes: 83 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: publish-image

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
pull_request:
branches: [ main, v2_devel, docker ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# use DOCKERHUB_USERNAME as the name maybe different from the github username
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
TAG: latest

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
-
name: Checkout repository
uses: actions/checkout@v2

# Workaround: https://github.com/docker/build-push-action/issues/461
-
name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

# Login against all registries
# https://github.com/docker/login-action
-
name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
-
name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
-
name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.TAG }}
labels: ${{ steps.meta.outputs.labels }}

-
name: retag and push multiplatform images to multiple registries
uses: akhilerm/tag-push-action@v2.0.0
with:
src: docker.io/${{ env.IMAGE_NAME }}:${{ env.TAG }}
# make sure the github name is correct
dst: ${{ env.REGISTRY }}/${{ github.actor }}/${{ github.event.repository.name }}:${{ env.TAG }}
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

###########################################################
# setup default directories and configs
FROM shitwolfymakes/arm-dependencies AS base
RUN \
mkdir -m 0777 -p /home/arm /home/arm/config /mnt/dev/sr0 /mnt/dev/sr1 /mnt/dev/sr2 /mnt/dev/sr3 && \
ln -sv /home/arm/config/arm.yaml /opt/arm/arm.yaml && \
ln -sv /opt/arm/apprise.yaml /home/arm/config/apprise.yaml && \
echo "/dev/sr0 /mnt/dev/sr0 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr1 /mnt/dev/sr1 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr2 /mnt/dev/sr2 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr3 /mnt/dev/sr3 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab

# copy ARM source last, helps with Docker build caching
COPY . /opt/arm/

EXPOSE 8080
#VOLUME /home/arm
VOLUME /home/arm/Music
VOLUME /home/arm/logs
VOLUME /home/arm/media
VOLUME /home/arm/config
WORKDIR /home/arm

ENTRYPOINT ["/opt/arm/scripts/docker-entrypoint.sh"]
CMD ["python3", "/opt/arm/arm/runui.py"]

###########################################################
# setup default directories and configs
FROM base as automatic-ripping-machine

# pass build args for labeling
ARG image_revision=2.5.9
ARG image_created="2022-03-16"

LABEL org.opencontainers.image.source=https://github.com/1337-server/automatic-ripping-machine
LABEL org.opencontainers.image.revision="2.5.9"
LABEL org.opencontainers.image.created="2022-03-16"
LABEL org.opencontainers.image.license=MIT
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Automatic Ripping Machine (ARM)
[![CI](https://github.com/1337-server/automatic-ripping-machine/actions/workflows/main.yml/badge.svg)](https://github.com/1337-server/automatic-ripping-machine/actions/workflows/main.yml)[![GitHub license](https://img.shields.io/github/license/1337-server/automatic-ripping-machine?style=plastic)](https://github.com/1337-server/automatic-ripping-machine/blob/v2_devel/LICENSE)
[![CI](https://github.com/1337-server/automatic-ripping-machine/actions/workflows/main.yml/badge.svg)](https://github.com/1337-server/automatic-ripping-machine/actions/workflows/main.yml)
[![GitHub license](https://img.shields.io/github/license/1337-server/automatic-ripping-machine?style=plastic)](https://github.com/1337-server/automatic-ripping-machine/blob/v2_devel/LICENSE)
[![GitHub forks](https://img.shields.io/github/forks/1337-server/automatic-ripping-machine?style=plastic)](https://github.com/1337-server/automatic-ripping-machine/network)
[![GitHub stars](https://img.shields.io/github/stars/1337-server/automatic-ripping-machine?style=plastic)](https://github.com/1337-server/automatic-ripping-machine/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/1337-server/automatic-ripping-machine?style=plastic)](https://github.com/1337-server/automatic-ripping-machine/issues)
Expand Down

0 comments on commit e2b12e3

Please sign in to comment.