diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..495838d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,20 @@ +name: Build & Test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist --snapshot --skip-publish diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d0ad231 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,19 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + name: Build and release image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - run: docker login -u "${{ secrets.DOCKER_LOGIN_USER }}" -p "${{ secrets.DOCKER_LOGIN_PASSWORD }}" quay.io + + - run: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9ef1196..0000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -language: go - -dist: xenial - -go: - - '1.13' - -services: - - docker - -addons: - apt: - packages: - - curl - - bash - - rpm - -env: - global: - - GO111MODULE=on - - CGO_ENABLED=0 - - GO_VERSION=1.13 - - GOLANG_LINT_VERSION=v1.21.0 - -before_script: - - sudo sysctl -w net.ipv4.ip_forward=1 - - wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANG_LINT_VERSION} - -script: - - golangci-lint run ./... || exit 1 - - curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist || exit 1 - -before_deploy: - - if [[ -n "${DOCKER_LOGIN_USERNAME}" ]] && [[ -n "${DOCKER_LOGIN_PASSWORD}" ]] && [[ -n "${DOCKER_LOGIN_URL}" ]]; then docker login -u "${DOCKER_LOGIN_USERNAME}" -p "${DOCKER_LOGIN_PASSWORD}" "${DOCKER_LOGIN_URL}"; fi - - export FULL_IMAGE="${DOCKER_LOGIN_URL}/mittwald/mittnite" -deploy: - - provider: script - cleanup: true - script: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist && docker push "${FULL_IMAGE}:latest" - on: - tags: false - branch: master - condition: $TRAVIS_OS_NAME = linux - - provider: script - cleanup: true - script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist - on: - tags: true - condition: $TRAVIS_OS_NAME = linux