Skip to content

Commit

Permalink
Convert to GitHub Actions from Travis CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Dec 28, 2020
1 parent ec79ed4 commit 58807e0
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

---
github: geerlingguy
patreon: geerlingguy
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Build

on:
pull_request:
push:
branches:
- master
schedule:
- cron: "10 2 * * 0"

jobs:
# Test the image builds and works correctly.
test:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Test building image.
run: docker build -t docker-ansible .

- name: Run the built image.
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro docker-ansible

- name: Verify Ansible is accessible in the built image.
run: docker exec --tty test-container env TERM=xterm ansible --version

# If on master branch, build and release image.
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1

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

- name: Build and push image.
uses: docker/build-push-action@v2
with:
context: ./
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ github.repository }}:latest
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CentOS 8 Ansible Test Image

[![Build Status](https://travis-ci.com/geerlingguy/docker-centos8-ansible.svg?branch=master)](https://travis-ci.com/geerlingguy/docker-centos8-ansible) [![Docker Automated build](https://img.shields.io/docker/automated/geerlingguy/docker-centos8-ansible.svg?maxAge=2592000)](https://hub.docker.com/r/geerlingguy/docker-centos8-ansible/)
[![CI](https://github.com/geerlingguy/docker-centos8-ansible/workflows/Build/badge.svg?branch=master&event=push)](https://github.com/geerlingguy/docker-centos8-ansible/actions?query=workflow%3ABuild) [![Docker pulls](https://img.shields.io/docker/pulls/geerlingguy/docker-centos8-ansible)](https://hub.docker.com/r/geerlingguy/docker-centos8-ansible/)

CentOS 8 Docker container for Ansible playbook and role testing.

Expand Down

0 comments on commit 58807e0

Please sign in to comment.