mirror of https://github.com/mpolden/echoip
build: Configure GitHub Actions
This commit is contained in:
parent
994c2529e9
commit
4f071cd6a2
|
@ -0,0 +1,29 @@
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: install go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15
|
||||||
|
- name: build and test
|
||||||
|
run: make
|
||||||
|
- name: enable experimental docker features
|
||||||
|
run: |
|
||||||
|
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json ~/.docker/config.json
|
||||||
|
sudo service docker restart
|
||||||
|
- name: build docker image
|
||||||
|
run: make docker-build
|
||||||
|
- name: publish docker image
|
||||||
|
run: make docker-push
|
||||||
|
- name: publish multi-arch docker image
|
||||||
|
run: make docker-pushx
|
23
.travis.yml
23
.travis.yml
|
@ -1,23 +0,0 @@
|
||||||
dist: bionic
|
|
||||||
language: minimal
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
|
|
||||||
- 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
|
|
||||||
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make docker-build
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
- provider: script
|
|
||||||
script: make docker-push
|
|
5
Makefile
5
Makefile
|
@ -57,7 +57,10 @@ docker-test:
|
||||||
$(eval DOCKER_PORT=$(shell $(DOCKER) port $(CONTAINER) | cut -d ":" -f 2))
|
$(eval DOCKER_PORT=$(shell $(DOCKER) port $(CONTAINER) | cut -d ":" -f 2))
|
||||||
curl -fsS -m 5 localhost:$(DOCKER_PORT) > /dev/null; $(DOCKER) stop $(CONTAINER)
|
curl -fsS -m 5 localhost:$(DOCKER_PORT) > /dev/null; $(DOCKER) stop $(CONTAINER)
|
||||||
|
|
||||||
docker-push: docker-test docker-multiarch-builder docker-login
|
docker-push: docker-test docker-login
|
||||||
|
$(DOCKER) push $(DOCKER_IMAGE)
|
||||||
|
|
||||||
|
docker-pushx: docker-multiarch-builder docker-login
|
||||||
$(DOCKER) buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t $(DOCKER_IMAGE) --push .
|
$(DOCKER) buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t $(DOCKER_IMAGE) --push .
|
||||||
|
|
||||||
xinstall:
|
xinstall:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# echoip
|
# echoip
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/mpolden/echoip.svg)](https://travis-ci.org/mpolden/echoip)
|
![Build Status](https://github.com/mpolden/echoip/workflows/ci/badge.svg)
|
||||||
|
|
||||||
A simple service for looking up your IP address. This is the code that powers
|
A simple service for looking up your IP address. This is the code that powers
|
||||||
https://ifconfig.co.
|
https://ifconfig.co.
|
||||||
|
|
Loading…
Reference in New Issue