mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2025-12-15 11:14:19 +01:00
Moved the build to GitHub actions (#2)
This commit is contained in:
36
.github/workflows/blank.yml
vendored
36
.github/workflows/blank.yml
vendored
@@ -1,36 +0,0 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the master branch
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Runs a single command using the runners shell
|
||||
- name: Run a one-line script
|
||||
run: echo Hello, world!
|
||||
|
||||
# Runs a set of commands using the runners shell
|
||||
- name: Run a multi-line script
|
||||
run: |
|
||||
echo Add other actions to build,
|
||||
echo test, and deploy your project.
|
||||
41
.github/workflows/build.yml
vendored
Normal file
41
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: CI to Docker Hub
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, github-actions ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
multi:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
repository: [restic-auto]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ${{ matrix.repository }}/
|
||||
file: ${{ matrix.repository }}/Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.repository }}:latest
|
||||
26
.travis.yml
26
.travis.yml
@@ -1,26 +0,0 @@
|
||||
language: bash
|
||||
services: docker
|
||||
sudo: required
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
slack:
|
||||
rooms:
|
||||
- secure: 3iUauEp7w5F6YDXXuJnKSLR9TZjndwhwWcDa+1KkAp9qv0NBAn1DWntl5iPUGzuZ0KdpQlI3QbvSMn0jYbsXgMDLgZRvCGaQ+TXrJblTPvlZXVxeGM3mCr6yEpt0foe8qqhiWAMer8ioM7QKncBiQfGbB2VctvuH8YqG2JuRSVe/dZxd+Jjn7J8SQyW97GQ0wpsYHQV7V2hg8KOF5/KNNk8Y93RGvnvEVX7XNVI+h+cdsxjBys9qxvC3gRpcngXw/v3mPM2sXN0LHjkobu9P9E7v9RHNwCz3i7FMzmOX82wcoPr06pnvnmecnU6pY3Uwmobed71KnTERSXt0S0Qpjvhod004vFBvzZovHKaucsUOzq0FdN+KaOhOZMr+LfCNty3iWZrEiYiuntFDAmr38xE0q4nb3dmljzEav8nTRO3/9DezWV98CBictzhwxknD/aPpWl7kXEl21K/jnprcJXypqNVscjJ/jylNiwebmFsv7oHlgeyzA9IbG8U7yO8kxCx86214FmPAJBkyAfevrQq9hOcigVwNuV7EoW5zqLTYb1pTyOkHSz/W9dKawjeG4c8ZTBsS1x6c+jQj735/MsQK0WMuaybOeTrVu6akKwXpiyZ4OGO7krHfCByXryZ56BNl7kb1J7aTjaLi0sifdc1X/eI6Y9nsHhc+Zyvv4AA=
|
||||
on_success: change
|
||||
|
||||
env:
|
||||
- IMAGE=restic-auto
|
||||
|
||||
install:
|
||||
- docker run --rm --privileged multiarch/qemu-user-static:register --credential yes
|
||||
|
||||
script:
|
||||
- cd ${IMAGE}
|
||||
- make build
|
||||
- docker images
|
||||
|
||||
after_success:
|
||||
- if [ "${TRAVIS_BRANCH}" == "master" ]; then
|
||||
make push ;
|
||||
fi
|
||||
@@ -6,7 +6,7 @@ RUN apk add --no-cache curl \
|
||||
&& bunzip2 restic.bz2 \
|
||||
&& chmod +x restic
|
||||
|
||||
FROM amd64/alpine:latest
|
||||
FROM alpine:latest
|
||||
|
||||
COPY --from=builder restic /usr/bin/
|
||||
|
||||
@@ -15,4 +15,5 @@ RUN apk add --no-cache bash curl jq openssh-client dcron tzdata
|
||||
COPY restic-auto docker-entrypoint.sh docker-command.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
|
||||
CMD ["/usr/local/bin/docker-command.sh"]
|
||||
@@ -1,21 +0,0 @@
|
||||
FROM alpine:latest AS builder
|
||||
|
||||
RUN apk add --no-cache curl \
|
||||
&& while [ "$QEMU_DOWNLOAD_URL" == "" ] ; do QEMU_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/multiarch/qemu-user-static/releases/latest | grep "browser_download_url" | grep "\/qemu-arm-static.tar.gz" | cut -d\" -f4) ; done \
|
||||
&& curl --retry 3 -L -s -o /tmp/qemu-arm-static.tar.gz $QEMU_DOWNLOAD_URL \
|
||||
&& tar xzf /tmp/qemu-arm-static.tar.gz \
|
||||
&& while [ "$DOWNLOAD_URL" == "" ] ; do DOWNLOAD_URL=$(curl -s https://api.github.com/repos/restic/restic/releases/latest | grep "browser_download_url" | grep "linux_arm\." | cut -d\" -f4) ; done \
|
||||
&& curl --retry 3 -L -s -o restic.bz2 ${DOWNLOAD_URL} \
|
||||
&& bunzip2 restic.bz2 \
|
||||
&& chmod +x restic
|
||||
|
||||
FROM arm32v6/alpine:latest
|
||||
|
||||
COPY --from=builder qemu-arm-static restic /usr/bin/
|
||||
|
||||
RUN apk add --no-cache bash curl jq openssh-client dcron tzdata
|
||||
|
||||
COPY restic-auto docker-entrypoint.sh docker-command.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
CMD ["/usr/local/bin/docker-command.sh"]
|
||||
@@ -1,19 +0,0 @@
|
||||
all: build push
|
||||
|
||||
build:
|
||||
docker build -t napnap75/restic-auto:latest-amd64 -f Dockerfile.amd64 .
|
||||
docker build -t napnap75/restic-auto:latest-arm32v6 -f Dockerfile.arm32v6 .
|
||||
|
||||
push:
|
||||
if [ "${DOCKER_USERNAME}" != "" ]; then docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}" ; fi
|
||||
docker push napnap75/restic-auto:latest-amd64
|
||||
docker push napnap75/restic-auto:latest-arm32v6
|
||||
env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create napnap75/restic-auto:latest napnap75/restic-auto:latest-amd64 napnap75/restic-auto:latest-arm32v6
|
||||
env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push -p napnap75/restic-auto:latest
|
||||
version=$$(docker run --rm -it napnap75/restic-auto:latest restic version | egrep -o "restic [.0-9]+ compiled" | egrep -o "[.0-9]+") ; \
|
||||
docker tag napnap75/restic-auto:latest-amd64 napnap75/restic-auto:$$version-amd64 ; \
|
||||
docker push napnap75/restic-auto:$$version-amd64 ; \
|
||||
docker tag napnap75/restic-auto:latest-arm32v6 napnap75/restic-auto:$$version-arm32v6 ; \
|
||||
docker push napnap75/restic-auto:$$version-arm32v6 ; \
|
||||
env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create napnap75/restic-auto:$$version napnap75/restic-auto:$$version-amd64 napnap75/restic-auto:$$version-arm32v6 ; \
|
||||
env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push -p napnap75/restic-auto:$$version
|
||||
Reference in New Issue
Block a user