Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release kcllang/kcl-go docker image #153

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: release
on:
push:
branches:
- "main"
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: Build and release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
# kcl-go build
- name: Build kcl-go
run: GOOS=linux GOARCH=amd64 go build ./cmds/kcl-go
shell: bash
- 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-go
- 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 }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ FROM kcllang/kcl

WORKDIR /app

COPY --from=builder /app/kcl-go .
RUN mkdir /app/bin
COPY --from=builder /app/kcl-go ./bin/

ENV PATH="/app/bin:${PATH}"
ENV LANG=en_US.utf8
Expand Down
Loading