Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from p1nkun1c0rns/performance_increase
Browse files Browse the repository at this point in the history
feat: change from build on action to pre build image
  • Loading branch information
steinbrueckri authored May 21, 2020
2 parents b2059d9 + 7277a4a commit dc81a91
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- 'dependabot/*'
schedule:
- cron: '22 22 * * 5'
env:
IMAGE: ${{ github.repository }}

jobs:
lint:
Expand Down Expand Up @@ -36,9 +38,17 @@ jobs:
- name: Run CI script
run: ./tests/run.bats

- name: Run action
uses: ./
with:
path: "./tests/data/good_case_1"
file_extension: "*.yaml"
exclude: "skip"
deploy:
needs: test
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build,Tag,Push Docker image
run: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USER }}" --password-stdin
# docker build
docker build -t ${IMAGE}:latest .
# docker push images
docker push ${IMAGE}
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:alpine3.11
FROM golang:alpine3.11 as builder

LABEL name="prometheus-operator-lint-action"
LABEL repository="http://github.com/p1nkun1c0rns/prometheus-operator-lint-action"
Expand All @@ -17,4 +17,9 @@ RUN apk add --no-cache \

RUN go get -u github.com/coreos/prometheus-operator/cmd/po-lint@v${PO_LINT_VERSION}

######## Start a new stage from scratch #######
FROM alpine:3.11.5
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY --from=builder /go/bin/po-lint /usr/local/bin/
ENTRYPOINT [ "/entrypoint.sh" ]
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
image: 'docker://p1nkun1c0rns/prometheus-operator-lint-action:latest'
args:
- ${{ inputs.path }}
- ${{ inputs.file_extension }}
Expand Down

0 comments on commit dc81a91

Please sign in to comment.