diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1c294fc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ + +name: release + +on: + push: + tags: + - "*" + +jobs: + image: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v2 + with: + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ github.sha }} + ghcr.io/${{ github.repository }}:latest + + - name: Export tgz + run: | + docker save ghcr.io/${{ github.repository }}:latest | gzip > gitpod-azure-aks-guide.tgz + + - name: Release + uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + artifacts: gitpod-azure-aks-guide.tgz + allowUpdates: true + artifactErrorsFailBuild: true + token: ${{ secrets.GITHUB_TOKEN }}