Skip to content

Add tests to sync job #56

Add tests to sync job

Add tests to sync job #56

Workflow file for this run

name: Publish
on: [push, pull_request]
jobs:
test:
services:
mongodb:
image: mongo:4
ports:
- 27017:27017
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19
- run: make test
publish:
needs:
- test
name: Publish
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: Surgo/docker-smart-tag-action@v1
id: smarttag
with:
docker_image: ""
default_branch: main
tag_with_sha: "true"
- uses: actions/setup-go@v2
with:
go-version: 1.19
- uses: actions/checkout@v2
- uses: imjasonh/[email protected]
env:
KO_DOCKER_REPO: tsuru
- env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
KO_DEFAULTBASEIMAGE: alpine:3.17.1
TO_BUILD_TAG: ${{ steps.smarttag.outputs.tag }}
run: |
export TAGS=$(echo -n "${TO_BUILD_TAG}" | sed 's/://g')
echo "Lets build tags: ${TAGS}"
echo "${DOCKERHUB_PASSWORD}" | ko login docker.io --username ${DOCKERHUB_USERNAME} --password-stdin
ko build -B --platform linux/arm64,linux/amd64 -t ${TAGS}