diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 482dfc26..d151b35d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,7 @@ jobs: id: branch - name: Set up Go 1.21 - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: 1.21.x id: go diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..ea8e5303 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,32 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + Publish: + runs-on: ubuntu-22.04 + name: Publish to docker repository + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker registry login + uses: docker/login-action@v2 + with: + registry: ${{ secrets.DOCKER_REPO }} + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PSWD }} + logout: true + + - name: Get Release Tag + id: get_release_tag + run: echo "::set-output name=tag::${{ github.event.release.tag_name }}" + + - name: Publish Docker image + uses: docker/build-push-action@v4 + with: + context: ${{ github.workspace }} + push: true + tags: docker.eu1.hsdp.io/reporting:${{ steps.get_release_tag.outputs.tag }}