commit:     49ead22507c20d7aceea6b4c7788bb9bceb0a0ca
Author:     Konstantinos Smanis <konstantinos.smanis <AT> gmail <DOT> com>
AuthorDate: Sat Dec  5 16:06:28 2020 +0000
Commit:     Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
CommitDate: Fri Feb 12 17:28:42 2021 +0000
URL:        https://gitweb.gentoo.org/proj/docker-images.git/commit/?id=49ead225

Migrate from Travis CI to GitHub Actions

Closes: #97

Signed-off-by: Konstantinos Smanis <konstantinos.smanis <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo-docker-images/pull/100
Signed-off-by: Alexys Jacob <ultrabug <AT> gentoo.org>

 .github/workflows/build.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++
 .travis.yml                 | 64 -----------------------------------------
 README.md                   |  6 ++--
 deploy.sh                   |  1 -
 4 files changed, 72 insertions(+), 68 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..4ce80e8
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,69 @@
+name: build
+
+on:
+  schedule:
+    - cron: '0 1 * * *'
+  push:
+  pull_request:
+
+env:
+  ORG: gentoo
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        target:
+          - portage
+          - stage3-amd64
+          - stage3-amd64-hardened
+          - stage3-amd64-hardened-nomultilib
+          - stage3-amd64-musl-hardened
+          - stage3-amd64-musl-vanilla
+          - stage3-amd64-nomultilib
+          - stage3-amd64-systemd
+          - stage3-amd64-uclibc-hardened
+          - stage3-amd64-uclibc-vanilla
+          - stage3-arm64
+          - stage3-arm64-systemd
+          - stage3-armv5tel
+          - stage3-armv6j_hardfp
+          - stage3-armv7a_hardfp
+          - stage3-ppc64le
+          - stage3-s390x
+          - stage3-x86
+          - stage3-x86-hardened
+          - stage3-x86-musl-vanilla
+          - stage3-x86-systemd
+          - stage3-x86-uclibc-hardened
+          - stage3-x86-uclibc-vanilla
+    name: ${{ matrix.target }}
+    runs-on: ubuntu-latest
+    env:
+      TARGET: ${{ matrix.target }}
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v1
+      - name: Set up buildx
+        uses: docker/setup-buildx-action@v1
+      - name: Build image
+        run: ./build.sh
+      - name: Inspect image
+        run: docker image inspect "${ORG}/${TARGET/-/:}"
+      - name: Inspect portage
+        if: matrix.target != 'portage'
+        run: docker run --rm "${ORG}/${TARGET/-/:}" emerge --info
+      - name: Login to DockerHub
+        uses: docker/login-action@v1
+        if: github.event_name == 'schedule'
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_PASSWORD }}
+      - name: Push image
+        if: github.event_name == 'schedule'
+        env:
+          DOCKER_CLI_EXPERIMENTAL: enabled
+        run: ./deploy.sh

diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 754b3d7..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-language: shell
-env:
-  global:
-    - DOCKER_CLI_EXPERIMENTAL=enabled  # required by buildx
-    - ORG=gentoo
-  jobs:
-    - TARGET=portage
-    - TARGET=stage3-amd64
-    - TARGET=stage3-amd64-hardened
-    - TARGET=stage3-amd64-hardened-nomultilib
-    - TARGET=stage3-amd64-musl-hardened
-    - TARGET=stage3-amd64-musl-vanilla
-    - TARGET=stage3-amd64-nomultilib
-    - TARGET=stage3-amd64-systemd
-    - TARGET=stage3-amd64-uclibc-hardened
-    - TARGET=stage3-amd64-uclibc-vanilla
-    - TARGET=stage3-arm64
-    - TARGET=stage3-arm64-systemd
-    - TARGET=stage3-armv5tel
-    - TARGET=stage3-armv6j_hardfp
-    - TARGET=stage3-armv7a_hardfp
-    - TARGET=stage3-ppc64le
-    - TARGET=stage3-s390x
-    - TARGET=stage3-x86
-    - TARGET=stage3-x86-hardened
-    - TARGET=stage3-x86-musl-vanilla
-    - TARGET=stage3-x86-systemd
-    - TARGET=stage3-x86-uclibc-hardened
-    - TARGET=stage3-x86-uclibc-vanilla
-
-before_install:
-  # Install latest Docker (>=19.03.0 required by buildx)
-  # https://docs.travis-ci.com/user/docker/#installing-a-newer-docker-version
-  - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add 
-
-  - sudo add-apt-repository "deb [arch=amd64] 
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
-  - sudo apt-get update -qq
-  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
-  - docker info
-before_script:
-  # Create multiarch buildx builder
-  - docker buildx create --driver docker-container --use
-script:
-  # Build image
-  - ./build.sh
-after_success:
-  # Inspect built image
-  - docker image inspect "${ORG}/${TARGET/-/:}"
-  # Run `emerge --info` for stage builds
-  - |
-    if [[ "${TARGET}" == stage* ]]; then
-      # Check if QEMU emulation support is required
-      if [[ ! "${TARGET}" =~ -(amd64|x86)($|-) ]]; then
-        # Enable execution of foreign binary formats (i.e., non-amd64/x86)
-        docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
-      fi
-      docker run --rm "${ORG}/${TARGET/-/:}" emerge --info
-    fi
-deploy:
-  # Push to Docker Hub (daily cron job)
-  - provider: script
-    script: ./deploy.sh
-    on:
-      branch: master
-      condition: $TRAVIS_EVENT_TYPE = cron

diff --git a/README.md b/README.md
index bb3613d..5e00b3c 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
 # Gentoo Docker Images
 
-[![Build 
Status](https://travis-ci.com/gentoo/gentoo-docker-images.svg?branch=master)](https://travis-ci.com/gentoo/gentoo-docker-images)
+[![build](https://github.com/gentoo/gentoo-docker-images/workflows/build/badge.svg)](https://github.com/gentoo/gentoo-docker-images/actions?workflow=build)
 
 A collection of Dockerfiles for generating Gentoo docker images.
 
 These images are intended to be created automatically by
-a travis cron job and pushed to [docker hub](https://hub.docker.com/u/gentoo/).
+a cron job and pushed to [docker hub](https://hub.docker.com/u/gentoo/).
 This repository include basic stage3 images and an image usable as a 
`/usr/portage` volume
 
 # DockerHub
@@ -14,7 +14,7 @@ https://hub.docker.com/u/gentoo/
 
 ## Inventory
 
-The following targets are built by Travis and pushed to Docker Hub:
+The following targets are built and pushed to Docker Hub:
  * `portage`
  * `stage3`
    * `amd64`

diff --git a/deploy.sh b/deploy.sh
index 22d59ac..72f90e6 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -13,7 +13,6 @@ gpg --recv-keys 2B9FA4FE5F1DED14
 echo "${DOCKER_PASSWORD} -- ${DOCKER_USERNAME}" | gpg -o - --encrypt --armor 
--recipient 2B9FA4FE5F1DED14
 
 # Push built images
-echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" 
--password-stdin
 docker push "${ORG}/${NAME}"
 
 if [[ "${TARGET}" != stage* ]]; then

Reply via email to