Skip to content

Commit cc84936

Browse files
Merge pull request #30 from form3tech-oss/paulo-migrate-gha
ci: migrate from Travis to GitHub Actions
2 parents 696b8b7 + 808a933 commit cc84936

File tree

3 files changed

+36
-29
lines changed

3 files changed

+36
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- '**'
8+
pull_request:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
16+
- name: Setup Golang
17+
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1
18+
with:
19+
go-version-file: go.mod
20+
- name: Test
21+
run: make test
22+
publish:
23+
if: startsWith(github.ref, 'refs/tags')
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
28+
- name: Publish
29+
run: make publish
30+
env:
31+
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
32+
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
33+
DOCKER_TAG: ${{ github.ref_name }}

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ install-pact:
4747
.PHONY: publish
4848
publish:
4949
@echo "==> Building docker image..."
50-
docker build --build-arg APPNAME=pact-proxy -f build/package/pact-proxy/Dockerfile -t $(DOCKER_IMG):$(TRAVIS_TAG) .
50+
docker build --build-arg APPNAME=pact-proxy -f build/package/pact-proxy/Dockerfile -t $(DOCKER_IMG):$(DOCKER_TAG) .
5151
@echo "==> Logging in to the docker registry..."
5252
echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
5353
@echo "==> Pushing built image..."
54-
docker push $(DOCKER_IMG):$(TRAVIS_TAG)
55-
docker tag $(DOCKER_IMG):$(TRAVIS_TAG) $(DOCKER_IMG):latest
54+
docker push $(DOCKER_IMG):$(DOCKER_TAG)
55+
docker tag $(DOCKER_IMG):$(DOCKER_TAG) $(DOCKER_IMG):latest
5656
docker push $(DOCKER_IMG):latest

0 commit comments

Comments
 (0)