Skip to content

Commit

Permalink
Merge pull request #30 from form3tech-oss/paulo-migrate-gha
Browse files Browse the repository at this point in the history
ci: migrate from Travis to GitHub Actions
  • Loading branch information
paulo-campos-form3 authored Nov 22, 2022
2 parents 696b8b7 + 808a933 commit cc84936
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 29 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- master
tags:
- '**'
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Setup Golang
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1
with:
go-version-file: go.mod
- name: Test
run: make test
publish:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Publish
run: make publish
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
DOCKER_TAG: ${{ github.ref_name }}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ install-pact:
.PHONY: publish
publish:
@echo "==> Building docker image..."
docker build --build-arg APPNAME=pact-proxy -f build/package/pact-proxy/Dockerfile -t $(DOCKER_IMG):$(TRAVIS_TAG) .
docker build --build-arg APPNAME=pact-proxy -f build/package/pact-proxy/Dockerfile -t $(DOCKER_IMG):$(DOCKER_TAG) .
@echo "==> Logging in to the docker registry..."
echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
@echo "==> Pushing built image..."
docker push $(DOCKER_IMG):$(TRAVIS_TAG)
docker tag $(DOCKER_IMG):$(TRAVIS_TAG) $(DOCKER_IMG):latest
docker push $(DOCKER_IMG):$(DOCKER_TAG)
docker tag $(DOCKER_IMG):$(DOCKER_TAG) $(DOCKER_IMG):latest
docker push $(DOCKER_IMG):latest

0 comments on commit cc84936

Please sign in to comment.