diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..31c623d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,35 @@ +name: release +on: + push: + branches: + - "main" + tags: + - "v*" +permissions: + contents: write +jobs: + test: + name: Build and release + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + submodules: "true" + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: kcllang/kcl-playground + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}