diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..069ce3a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Test and release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + test-and-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '^1.19' + - uses: ko-build/setup-ko@v0.6 + - name: Run tests + run: go test -v ./... + - name: Login to GCR + uses: docker/login-action@v2 + with: + registry: gcr.io + username: _json_key + password: ${{ secrets.GCR_JSON_KEY }} + - name: Release + run: | + build_tag="${{ github.ref_name }}" + if [[ "$build_tag" != *-alpha ]]; then + build_tag += ",latest" + fi + ./deploy/scripts/build.sh "$build_tag" gcr.io/edgedelta all \ No newline at end of file