mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2026-01-21 22:52:18 +02:00
github actions test
This commit is contained in:
82
.github/workflows/docker_build_dev_image.yml
vendored
82
.github/workflows/docker_build_dev_image.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
# Github action to build Docker image from dev branch (tag: testing)
|
# Github action to build Docker image from dev branch (tag: dev)
|
||||||
|
|
||||||
name: Build Docker image from dev
|
name: Build Docker image from dev
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bulid_dev:
|
bulid_dev:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: 'buanet/ioBroker.docker'
|
repository: 'buanet/ioBroker.docker'
|
||||||
ref: 'dev'
|
ref: 'dev'
|
||||||
|
|
||||||
- name: Get and write version and date
|
- name: Get and write version and date
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
@@ -45,12 +45,16 @@ jobs:
|
|||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
run: docker run --rm --privileged multiarch/qemu-user-static:register
|
run: docker run --rm --privileged multiarch/qemu-user-static:register
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1.3.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
@@ -58,16 +62,62 @@ jobs:
|
|||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build an push Docker image (amd64)
|
- name: Build Docker image (amd64)
|
||||||
|
uses: docker/build-push-action@v2.6.1
|
||||||
|
with:
|
||||||
|
context: ./amd64
|
||||||
|
file: ./amd64/Dockerfile
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: |
|
||||||
|
buanet/iobroker:dev-amd64,
|
||||||
|
ghcr.io/buanet/iobroker:dev-amd64
|
||||||
|
|
||||||
|
- name: Build Docker image (armv32v7)
|
||||||
|
uses: docker/build-push-action@v2.6.1
|
||||||
|
with:
|
||||||
|
context: ./arm32v7
|
||||||
|
file: ./arm32v7/Dockerfile
|
||||||
|
push: true
|
||||||
|
platforms: linux/arm/v7
|
||||||
|
tags: |
|
||||||
|
buanet/iobroker:dev-arm32v7,
|
||||||
|
ghcr.io/buanet/iobroker:dev-arm32v7
|
||||||
|
|
||||||
|
- name: Build Docker image (arm64v8)
|
||||||
|
uses: docker/build-push-action@v2.6.1
|
||||||
|
with:
|
||||||
|
context: ./arm64v8
|
||||||
|
file: ./arm64v8/Dockerfile
|
||||||
|
push: true
|
||||||
|
platforms: linux/arm64
|
||||||
|
tags: |
|
||||||
|
buanet/iobroker:dev-arm64v8,
|
||||||
|
ghcr.io/buanet/iobroker:dev-arm64v8
|
||||||
|
|
||||||
|
- name: Create and push manifests
|
||||||
run: |
|
run: |
|
||||||
echo "Building amd64..."
|
sed -e "s/\${VERSION}/dev/g" -e "s/\${DOCKERTAG}/dev/g" ./manifest.yml > manifest_dev.yaml
|
||||||
sed -i "s/\${VERSION}/devbuild/g" ./amd64/scripts/iobroker_startup.sh
|
./manifest-tool --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASS }} push from-spec manifest_dev.yaml
|
||||||
docker build -t "buanet/iobroker:dev-amd64" ./amd64
|
sed -e "s/\${VERSION}/dev/g" -e "s/\${DOCKERTAG}/dev/g" ./manifest_ghcr.yml > manifest_ghcr_dev.yaml
|
||||||
docker tag "buanet/iobroker:dev-amd64" "iobroker/iobroker:dev-amd64"
|
./manifest-tool --username ${{ secrets.PACKAGES_USER }} --password ${{ secrets.PACKAGES_PASS }} push from-spec manifest_ghcr_dev.yaml
|
||||||
echo "Done."
|
|
||||||
echo ''
|
- name: Delete untagged images from GitHub packages
|
||||||
echo "Pushing images to buanet/iobroker..."
|
uses: actions/github-script@v3
|
||||||
docker push "buanet/iobroker:dev-amd64"
|
with:
|
||||||
echo "Done."
|
github-token: ${{ secrets.PACKAGES_PASS }}
|
||||||
echo ''
|
script: |
|
||||||
|
const response = await github.request("GET /users/${{ env.OWNER }}/packages/container/${{ env.PACKAGE_NAME }}/versions",
|
||||||
|
{ per_page: ${{ env.PER_PAGE }}
|
||||||
|
});
|
||||||
|
for(version of response.data) {
|
||||||
|
if (version.metadata.container.tags.length == 0) {
|
||||||
|
console.log("delete " + version.id)
|
||||||
|
const deleteResponse = await github.request("DELETE /user/packages/container/${{ env.PACKAGE_NAME }}/versions/" + version.id, { });
|
||||||
|
console.log("status " + deleteResponse.status)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
OWNER: buanet
|
||||||
|
PACKAGE_NAME: iobroker
|
||||||
|
PER_PAGE: 100
|
||||||
|
|||||||
@@ -35,9 +35,6 @@ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash \
|
|||||||
&& apt-get update && apt-get install -y nodejs \
|
&& apt-get update && apt-get install -y nodejs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Testing
|
|
||||||
RUN cat /proc/self/cgroup
|
|
||||||
|
|
||||||
# Generating locales
|
# Generating locales
|
||||||
RUN sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
|
RUN sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
|
||||||
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
|
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
|
||||||
|
|||||||
Reference in New Issue
Block a user