diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..800073c8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,63 @@ +name: Release + +on: + push: + tags: + - "v*.*" + +jobs: + artifacts: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: Build + run: ./cross-compile.sh + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: "dist/*" + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + + - name: Publish to Docker Hub + uses: actions/docker-publish@v2 + with: + repo: ncipollo/ncipollo + tag: ${{ secrets.DOCKER_TAG }} + login: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} + push: true + force: true + + docker: + runs-on: ubuntu-latest + steps: + - name: Get tag + id: tag + run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: abutaha/aws-es-proxy:${{ steps.tag.outputs.tag }},abutaha/aws-es-proxy:latest