Skip to content

Commit

Permalink
Merge pull request #15 from wide-vsix/actions
Browse files Browse the repository at this point in the history
Actions support container image build
  • Loading branch information
slankdev authored Oct 25, 2022
2 parents 4b17c69 + ebacb6e commit d0b6de0
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: latest origin/main
name: branch binary

on:
push:
branches:
- "main"
- main

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release tag
name: release binary

on:
push:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/image_branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: branch container-image

on:
push:
branches:
- main

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: clone repo
uses: actions/checkout@v2

- name: login ghcr
id: login_docker
uses: docker/login-action@v1
with:
registry: ghcr.io
username: vsix-robot
password: ${{ secrets.VSIX_ROBOT }}

- name: push with branch name
id: run_docker_push_with_branch_name
run: >
docker build -t ghcr.io/wide-vsix/linux-flow-exporter:branch-main .
&& docker push ghcr.io/wide-vsix/linux-flow-exporter:branch-main
env:
BUILDKIT: 1
28 changes: 28 additions & 0 deletions .github/workflows/image_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release container-image
on:
push:
tags:
- 'v*'

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: clone repo
uses: actions/checkout@v2

- name: login ghcr
id: login_docker
uses: docker/login-action@v1
with:
registry: ghcr.io
username: vsix-robot
password: ${{ secrets.VSIX_ROBOT }}

- name: push with branch name
id: run_docker_push_with_branch_name
run: >
docker build -t ghcr.io/wide-vsix/linux-flow-exporter:${{ github.ref }} .
&& docker push ghcr.io/wide-vsix/linux-flow-exporter:${{ github.ref }}
env:
BUILDKIT: 1
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ RUN echo ". <(flowctl completion bash)" >> /root/.bashrc

# FINAL STAGE
FROM scratch
LABEL org.opencontainers.image.source https://github.com/wide-vsix/linux-flow-exporter
COPY --from=rootfs / /

0 comments on commit d0b6de0

Please sign in to comment.