diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0f88ae6c..b06366b4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,17 +2,16 @@ name: Docker Image CI on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - + tags: + - "*.*.*" jobs: - - build: - + build_and_push: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag go-proxy:$(date +%s) --tag go-proxy:0.4 --tag go-proxy:latest + - name: Get the version + uses: actions/checkout@v3 + id: get_version + - name: Build and Push Container to ghcr.io + uses: GlueOps/github-actions-build-push-containers@v0.3.7 + with: + tags: latest,${{ steps.get_version.outputs.VERSION }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2dc1362a..2f4b93d1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,30 +5,26 @@ name: Go on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + tags: + - "*.*.*" jobs: - build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22.1' + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.22.1" - - name: Build - run: make build - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: go-proxy - path: bin/go-proxy + - name: Build + run: make build + - name: Release + uses: softprops/action-gh-release@v2 + with: + path: bin/go-proxy #- name: Test # run: go test -v ./...