diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..1d40129 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,52 @@ +name: main-worklfow + +env: {} + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + # Run all unit tests. + run-tests: + runs-on: ubuntu-latest + steps: + # Check out the pull request's source code. + - name: Check out source code + uses: actions/checkout@v3 + + # Install Go. + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "^1.14" # The Go version to download and use. + - name: Print Go version + run: go version + + # Run unit tests. + - name: Run unit tests + run: go test -v ./... + + # Build and release. +build-and-release: + runs-on: ubuntu-latest + steps: + # Check out source code. + - name: Check out source code + uses: actions/checkout@v3 + + # Build and push container image. + - name: Build and push container image + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.IMAGE_REPOSITORY }} + tag_with_ref: true + tag_with_sha: true # sha-${GITHUB_SHA::7} + + \ No newline at end of file