Skip to content

Commit

Permalink
Added gosec
Browse files Browse the repository at this point in the history
  • Loading branch information
dooman87 committed Feb 3, 2025
1 parent 2373020 commit 2a2898b
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Cache Docker layers
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Build a dev image
- name: Build a dev image
id: docker_build_dev
uses: docker/build-push-action@v5
with:
Expand All @@ -45,32 +42,25 @@ jobs:
tags: transformimgs-dev
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Gosec
- name: Gosec
id: gosec
uses: securego/gosec@master
with:
args:
- -exclude-dir illustration
- ./...
-
name: Gosec illustration
args: -exclude-dir illustration ./...
- name: Gosec illustration
id: gosecillustration
working-directory: ./illustration
uses: securego/gosec@master
with:
args:
- ./...
-
name: Run tests
args: ./...
- name: Run tests
run: |
docker run --entrypoint=/go/src/github.com/Pixboost/transformimgs/test.sh -v $(pwd):/go/src/github.com/Pixboost/transformimgs transformimgs-dev
- id: codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
-
name: Build a prod image
- name: Build a prod image
id: docker_build_prod
uses: docker/build-push-action@v5
with:
Expand All @@ -83,17 +73,14 @@ jobs:
"BRANCH=${{ github.ref_name }}"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Run the service
- name: Run the service
run: |
docker run -p 8080:8080 -d transformimgs
sleep 5
-
name: Smoketest
- name: Smoketest
run: |
curl -o /dev/null -f http://localhost:8080/img/https://pixboost.com/img/homepage/hero.jpg/resize?size=x600
-
name: Publish image
- name: Publish image
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit 2a2898b

Please sign in to comment.